﻿<%
'
'	七色虎建站系统
'	表现层文件Ui.asp
'	用于展现网站
'	v1.2.6 beta2
'	2011.9.3
'	2012.2.25

'
' 表现层函数，外部可以直接引用
' 要求：共同属性写入底层，这部分只是用于展现
' 函数命名：showMyName


'Wap1.0首页
Sub showIndex
	w "<card title="""&waptitle&"""><p align="""&wapconst&"""><a id=""top"" name=""top""></a>"
	if wapfavor=1 then w ""&getfavor&"<br/>"
	if len(wapday) > 7 then w getDiff(wapday,wapdayname)&"<br/>"
	If Len(waplogo) > 7 Then w "<img src="""&waplogo&""" alt="""&waptitle&"""/><br/>"
	checkMsg()'信息
	classPage(0)'首页
	If waplink = 1 Then w toplink(8,4)'首链
	If waplastc = 0 Then waplast=""'底部导航不显示
End Sub
'Wap2.0首页
Sub showsIndex
	w "<title>"&waptitle&"</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
	if wapfavor=1 then w getfavor&"<br/>"
	if len(wapday) > 7 then w "<div class=""tip"">"&getDiff(wapday,wapdayname)&"</div>"
	If Len(waplogo) > 7 Then w "<img src='"&waplogo&"' alt='"&waptitle&"'/><br/>"
	checkMsg()'信息
	classPage(0)'首页
	If waplink = 1 Then w toplink(8,4)'首链
	If waplastc = 0 Then waplast=""'底部导航不显示
End Sub
'Wap1.0文章页
Sub showArticle
	Dim p,rs,sql,hit,author,tpl,ids,rss,title,savetime,id,userid
	id=getN("id",1)
	tpl=ubbcode(tplarticle)
	p=getN("p",1)
	userid=userArr(0)
	Set rs = Server.CreateObject("ADODB.Recordset")
	sql="Select title,test,hit,smspin,classid,HU_author,HU_date from 74hu_article where id="&id
	rs.open sql,conn,1,3
	if rs.eof then
		rs.close
		set rs=Nothing
		r ""&http_path&"?aid=index&"&a_sid&""
	end if
	ids=rs("classid")
	title=nowml(rs("title"))
	savetime=forDate(rs("HU_date"))
	author=rs("HU_author")
	If IsNumeric(author) Then
		author="<a href="""&http_path&"bbs_user.asp?id="&author&"&amp;"&a_sid&""">"&noubb(getUserName(author))&"</a>"
	Else
		author=nowml(author)
	End If
	Set rss = Server.CreateObject("ADODB.Recordset")
	sql="Select class from 74hu_list where classid="&ids
	rss.open sql,conn,3,1
	if rss.eof then
		rss.close
		set rss=Nothing
		r ""&http_path&"?aid=index&"&a_sid&""
	end if
	hit=1
	if numhit>0 then
		Randomize
		hit=Int(Rnd*numhit)+1
	end if
	hit=rs("hit")+hit
	rs("hit")=hit
	rs.update()
	If waphits=0 Then hit = "100%"
	w "<card title='"&title&"-"&rss("class")&"'><p align="""&wapconst&"""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	w "-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-<a href='"&http_path&"list.asp?id="&ids&"&amp;page="&p&"&amp;"&a_sid&"'>"&rss("class")&"</a>-正文<br/>"
	Dim Counts,Content,pageWordNum,StartWord,Length,PageAll,page,i,arr,discuss,ad3txt,rndtxt,ad2txt,input
	Counts=rs("smspin")
	Content=rs("test")
	ad2txt=getAD(2,1)
	pageWordNum=numarticle
	StartWord = 1
	Length=len(Content)
	PageAll=(Length+PageWordNum-1)\PageWordNum
	page=getN("page",1)
	if page<1 then page=1
	i=int(page-1)
	if page>PageAll then page=PageAll
	if isnull(i) or IsNumeric(i)=False then i=0
	if instr(content,"||")>0 then
		arr=split(content,"||")
		PageAll=ubound(arr)+1
		if i>PageAll-1 then i=PageAll-1
		content = arr(i)
	else
		if clng(i)>int(PageAll) then i=PageAll-1
		Content = mid(Content,StartWord+i*PageWordNum,PageWordNum)
	end if
	content = ubbcode(content)&"<br/>"&showPage("article.asp", "p:"&p&",id:"&id, i+1, PageAll)

	sql = "select top 4 pl from 74hu_pl where smsid="&id&" order by id desc"
	rs.close
	rs.open sql,conn,1,1
	If Not rs.eof Then
		For i=0 To 4
			If rs.eof Then Exit For
			discuss=discuss& (counts - i)&"楼."&getLeft(noad(noubb(rs("pl"))),15)&"<br/>"
			rs.movenext
		Next
	End If
	discuss=discuss& "<a href="""&http_path&"discuss.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&""">网友评论("&Counts&")</a>"
	If wapdiscuss=1 And userid=0 Then
		input ="<a href="""&http_path&"bbs_login.asp?_u="&back_url&""">登录评论文章</a><br/>"
	Else
		input="<input type=""text"" name=""pl"&Time_r&""" title=""输入内容"" value="""" maxlength=""200""/><br/>"&_
			"<anchor title=""确定"">提交<go method=""post"" href="""&http_path&"comment.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&""">"&_
			"<postfield name=""pl"" value=""$(pl"&Time_r&")""/></go></anchor><br/>"
	End If
	Dim rs1,nexttxt,prevtxt
	set rs1=server.createobject("adodb.recordset")
	sql="select top 1 id,test,title from 74hu_article where classid="&ids&" and id<"&id&" order by id desc"
	rs1.open sql,conn,3,1
	if rs1.recordcount>0 then nexttxt= "<a href="""&http_path&"article.asp?id="&rs1("id")&"&amp;p="&p&"&amp;"&a_sid&""">&gt;&gt;"&nowml(rs1("title"))&"</a><br/>"
	rs1.close
	sql="select top 1 id,test,title from 74hu_article where classid="&ids&" and id>"&id&" order by id asc"
	rs1.open sql,conn,3,1
	if rs1.recordcount>0 then prevtxt= "<a href="""&http_path&"article.asp?id="&rs1("id")&"&amp;p="&p&"&amp;"&a_sid&""">&lt;&lt;"&nowml(rs1("title"))&"</a><br/>"
	rs1.close
	set rs1=nothing
	rndtxt=getArticle(ids,3,3)
	ad3txt=getAD(3,1)
	rs.close
	set rs=nothing
	rss.close
	set rss=nothing
	Dim rndnum
	rndnum=time_r'要避免内容中有{}标签,需将{}转义
	tpl=Replace(tpl,"{","{_74hu_"&rndnum)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"time}",savetime,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"hit}",hit,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"source}",author,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"next}",nexttxt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"ad2}",ad2txt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"ad3}",ad3txt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"title}",title,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"prev}",prevtxt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"rnd}",rndtxt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"input}",input,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"content}",content,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"discuss}",discuss,1,1)
	tpl=Replace(tpl,"<br/><br/>","<br/>")
	w tpl
End Sub
'Wap2.0文章页
Sub showsArticle
	Dim p,rs,sql,hit,author,tpl,ids,rss,title,savetime,id,userid
	id=getN("id",1)
	tpl=ubbcode(tplarticle)
	p=getN("p",1)
	userid=userArr(0)
	Set rs = Server.CreateObject("ADODB.Recordset")
	sql="Select title,test,hit,smspin,classid,HU_author,HU_date from 74hu_article where id="&id
	rs.open sql,conn,1,3
	if rs.eof then
		rs.close
		set rs=Nothing
		r ""&http_path&"?aid=index&"&a_sid&""
	end if
	ids=rs("classid")
	title=nowml(rs("title"))
	savetime=forDate(rs("HU_date"))
	author=rs("HU_author")
	If IsNumeric(author) Then
		author="<a href="""&http_path&"bbs_user.asp?id="&author&"&amp;"&a_sid&""">"&noubb(getUserName(author))&"</a>"
	Else
		author=nowml(author)
	End If
	Set rss = Server.CreateObject("ADODB.Recordset")
	sql="Select class from 74hu_list where classid="&ids
	rss.open sql,conn,3,1
	if rss.eof then
		rss.close
		set rss=Nothing
		r ""&http_path&"?aid=index&"&a_sid&""
	end if
	hit=1
	if numhit>0 then
		Randomize
		hit=Int(Rnd*numhit)+1
	end if
	hit=rs("hit")+hit
	rs("hit")=hit
	rs.update()
	If waphits=0 Then hit = "100%"
	w "<title>"&title&"-"&rss("class")&"</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	w "<div class=""nav"">-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-<a href='"&http_path&"list.asp?id="&ids&"&amp;page="&p&"&amp;"&a_sid&"'>"&rss("class")&"</a>-正文</div>"
	Dim Counts,Content,pageWordNum,StartWord,Length,PageAll,page,i,arr,pageShow,view,discuss,ad3txt,rndtxt,ad2txt,input
	Counts=rs("smspin")
	ad2txt=getAD(2,1)
	StartWord = 1
	Content=rs("test")
	page=getN("page",1)
	if page<1 then page=1
	view=getData("view")
	If view<>"all" Then
		Length=len(Content)
		pageWordNum=numarticle
		i=int(page-1)
		PageAll=(Length+PageWordNum-1)\PageWordNum
		if isnull(i) or IsNumeric(i)=False then i=0
		if instr(content,"||")>0 then
			arr=split(content,"||")
			PageAll=ubound(arr)+1
			if i>PageAll-1 then i=PageAll-1
			content = arr(i)
		else
			if clng(i)>int(PageAll) then i=PageAll-1
			Content = mid(Content,StartWord+i*PageWordNum,PageWordNum)
		end if
		If PageAll>1 Then pageShow="<a href="""&http_path&"article.asp?id="&id&"&amp;"&a_sid&"&amp;view=all"">[显示全文]</a><br/>"
	Else
		Content=Replace(Content,"||","")
		Length=len(Content)
		pageWordNum=3000'内容太多,每页显示3000字
		PageAll=(Length+PageWordNum-1)\PageWordNum
		if page>PageAll then page=PageAll
		i=int(page-1)
		If Length>pageWordNum Then pageShow="<span class=""tip"">内容过多,每页显示"&pageWordNum&"字</span>"
		Content = mid(Content,StartWord+i*PageWordNum,PageWordNum)
		pageShow="<a href="""&http_path&"article.asp?id="&id&"&amp;"&a_sid&""">[分页显示]</a>"&pageShow&"<br/>"
	End If
	content=pageShow & ubbcode(content)&"<br/>"& showsPage("article.asp", "p:"&p&",id:"&id&",view:"&view, i+1, PageAll)
	sql = "select top 4 pl from 74hu_pl where smsid="&id&" order by id desc"
	rs.close
	rs.open sql,conn,1,1
	If Not rs.eof Then
		For i=0 To 4
			If rs.eof Then Exit For
			discuss=discuss& (counts - i)&"楼."&getLeft(noad(noubb(rs("pl"))),15)&"<br/>"
			rs.movenext
		Next
	End If
	discuss=discuss& "<a href="""&http_path&"discuss.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&""">网友评论("&Counts&")</a>"
	If wapdiscuss=1 And userid=0 Then
		input ="<a href="""&http_path&"bbs_login.asp?_u="&back_url&""">登录评论文章</a><br/>"
	Else
		input="<form name=""art"" action="""&http_path&"comment.asp"" method=""post"">"&_
		"<input type=""text"" name=""pl"" value="""" maxlength=""200""/>"&_
		"<input type=""hidden"" name=""id"" value="""&id&"""/><input type=""hidden"" name=""p"" value="""&p&"""/>"&_
		"<input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/><input type=""submit"" value=""提交""/></form><br/>"
	End If
	Dim rs1,nexttxt,prevtxt
	set rs1=server.createobject("adodb.recordset")
	sql="select top 1 id,test,title from 74hu_article where classid="&ids&" and id<"&id&" order by id desc"
	rs1.open sql,conn,3,1
	if rs1.recordcount>0 then nexttxt= "<a href="""&http_path&"article.asp?id="&rs1("id")&"&amp;p="&p&"&amp;"&a_sid&""">&gt;&gt;"&nowml(rs1("title"))&"</a><br/>"
	rs1.close
	sql="select top 1 id,test,title from 74hu_article where classid="&ids&" and id>"&id&" order by id asc"
	rs1.open sql,conn,3,1
	if rs1.recordcount>0 then prevtxt= "<a href="""&http_path&"article.asp?id="&rs1("id")&"&amp;p="&p&"&amp;"&a_sid&""">&lt;&lt;"&nowml(rs1("title"))&"</a><br/>"
	rs1.close
	set rs1=nothing
	rndtxt=getArticle(ids,3,3)
	ad3txt=getAD(3,1)
	rs.close
	set rs=nothing
	rss.close
	set rss=nothing
	Dim rndnum
	rndnum=time_r'要避免内容中有{}标签,需将{}转义
	tpl=Replace(tpl,"{","{_74hu_"&rndnum)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"time}",savetime,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"hit}",hit,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"source}",author,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"next}",nexttxt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"ad2}",ad2txt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"ad3}",ad3txt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"title}",title,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"prev}",prevtxt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"rnd}",rndtxt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"input}",input,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"content}",content,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"discuss}",discuss,1,1)
	w tpl
End Sub
'Wap1.0 新页面页
Sub showClass
	Dim rs1,id
	id=getN("id",1)
	Set rs1 = Server.CreateObject("ADODB.Recordset")
	rs1.open "Select class from 74hu_class where classid="&id,conn,1,1
	If Not rs1.eof Then
		w "<card title='"&nowml(rs1("class"))&"-"&waptitle&"'><p align="""&wapconst&"""><a id=""top"" name=""top""></a>"
		checkMsg()'信息
		classPage(id)'页面
	Else
		w "<card title='页面出错'><p align="""&wapconst&""">页面不存在或已删除<br/>"
	End If
	rs1.close
	Set rs=Nothing
End Sub
'Wap2.0 新页面页
Sub showsClass
	Dim rs1,id
	id=getN("id",1)
	Set rs1 = Server.CreateObject("ADODB.Recordset")
	rs1.open "Select class from 74hu_class where classid="&id,conn,1,1
	If Not rs1.eof Then
		w "<title>"&nowml(rs1("class"))&"-"&waptitle&"</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
		checkMsg()'信息
		classPage(id)'页面
	Else
		w "<title>页面出错</title></head><body><div class=""main"">页面不存在或已删除<br/>"
	End If
	rs1.close
	Set rs=Nothing
End Sub
' Wap1.0评论页
Sub showDiscuss
	Dim p,rs,id,userid
	id=getN("id",1)
	p=getN("p",1)
	userid=userArr(0)
	w "<card title=""网友跟贴""><p align="""&wapconst&"""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	w "-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-"
	if id<>0 then
		w "<a href="""&http_path&"article.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&""">查看原文</a>-跟贴<br/>"
	else
		w "网站群聊<br/>"
	end if
	If wapdiscuss=1 And userid=0 Then
		w "<a href="""&http_path&"bbs_login.asp?_u="&back_url&""">登录评论文章</a><br/>"
	Else
		w "发表评论：<br/>"&_
		"<input type=""text"" name=""pl"&Time_r&""" title=""输入内容"" value="""" maxlength=""200""/><br/>"&_
		"<anchor title=""确定"">提交"&_
		"<go method=""post"" href="""&http_path&"comment.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&""">"&_
		"<postfield name=""pl"" value=""$(pl"&Time_r&")""/>"&_
		"</go></anchor><br/>"
	End If
	w "【网友评论区】<br/>"
	set rs=Server.CreateObject("ADODB.Recordset")
	rs.open"select pl,pltime,ip from 74hu_pl where smsid="&id&" order by id desc",conn,3,1
	If Not rs.eof Then
		Dim PageSize,page,pagecount,i,count,tid
		PageSize=8
		page=getN("page",1)
		page=int(page)
		if page<=0 then page=1
		count=rs.recordcount
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount Then page=pagecount
		rs.move(pagesize*(page-1))
		tid=count-(page-1)*pagesize
		For i=1 To PageSize
			If rs.eof Then Exit For
			ip=rs("ip")
			If ip<>"" And IsNumeric(ip) Then
				ip="<a href="""&http_path&"bbs_user.asp?id="&ip&"&amp;"&a_sid&""">"&getUserName(ip)&"</a>"
			Else
				ip="网友"
			End If
			w tid&"楼."&ip &" "&fordate2(rs("pltime"))&"<br/>　"&nowml(noad(rs("pl")))&"<br/>"
			tid=tid-1
			rs.moveNext
		Next
		w showPage("discuss.asp", "p:"&p&",id:"&id, page, pagecount)
	Else
		w "暂时没有评论！<br/> "
	end if
	rs.close
	set rs=nothing
	if id<>0 Then w "<a href='"&http_path&"article.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&"'>返回原文</a> <a href='"&http_path&"list.asp?p="&p&"&amp;"&a_sid&"'>返回上级栏目</a><br/>"
End Sub
' Wap2.0评论页
Sub showsDiscuss
	Dim p,rs,id,userid
	id=getN("id",1)
	p=getN("p",1)
	userid=userArr(0)
	w "<title>网友跟贴</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-"
	if id<>0 then
		w "<a href="""&http_path&"article.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&""">查看原文</a>-跟贴</div>"
	Else
		w "网站群聊</div>"
	End If
	If wapdiscuss=1 And userid=0 Then
		w "<a href="""&http_path&"bbs_login.asp?_u="&back_url&""">登录评论文章</a><br/>"
	Else
		w  "发表评论：<br/><form name=""dis"" action="""&http_path&"comment.asp"" method=""post""><input type=""text"" name=""pl"" value="""" maxlength=""200""/>"&_
		  "<input type=""hidden"" name=""id"" value="""&id&"""/><input type=""hidden"" name=""p"" value="""&p&"""/>"&_
		  "<input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/><br/><input type=""submit"" value=""提交""/></form>"
	End If
	w "<div class=""nav"">※网友评论区</div>"
	set rs=Server.CreateObject("ADODB.Recordset")
	rs.open"select pl,pltime,ip from 74hu_pl where smsid="&id&" order by id desc",conn,3,1
	If Not rs.eof Then
		Dim PageSize,page,i,pagecount,ip,count,tid
		PageSize=8
		page=getN("page",1)
		page=int(page)
		if page<=0 then page=1
		count=rs.recordcount
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount Then page=pagecount
		rs.move(pagesize*(page-1))
		tid=count-(page-1)*pagesize
		For i=1 To PageSize
			If rs.eof Then Exit For
			ip=rs("ip")
			If ip<>"" And IsNumeric(ip) Then
				ip="<a href="""&http_path&"bbs_user.asp?id="&ip&"&amp;"&a_sid&""">"&getUserName(ip)&"</a>"
			Else
				ip="网友"
			End If
			w "<div class=""odd"">"&tid&"楼."&ip &" "& fordate2(rs("pltime"))&"</div><div class=""even"">"& nowml(noad(rs("pl")))&"</div>"
			tid=tid-1
			rs.moveNext
		Next
		w showsPage("discuss.asp", "p:"&p&",id:"&id, page, pagecount)&"<br/>"
	Else
		w "暂时没有评论！<br/> "
	end if
	rs.close
	set rs=nothing
	if id<>0 Then w "<div class=""nav""><a href='"&http_path&"article.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&"'>返回原文</a> <a href='"&http_path&"list.asp?p="&p&"&amp;"&a_sid&"'>返回上级栏目</a></div>"
End Sub
' Wap1.0 讨论页
Sub showComment
	Dim o,rs,id
	id=getN("id",1)
	w "<card title='发表评论'>"
	Dim pl,p,pl_len,ip,err_str
	pl=getD("pl","")
	p=getN("p",1)
	pl_len=len(pl)
	err_str=""
	if pl_len=0 then err_str="评论内容不能为空！"
	if pl_len<numdiscuss*1 And err_str="" then err_str="评论内容最少"&numdiscuss&"字！"
	if pl_len>100 And err_str="" Then err_str="评论内容最多100字！"
	if id<>0 And err_str="" then
		if 0=conn.execute("select count(id) from 74hu_article where id="&id)(0) then err_str="评论文章不存在！"
		if 0<conn.execute("select count(id) from 74hu_pl where pl='"&pl&"' and smsid="&id)(0) then err_str="评论内容已存在！请不要重复提交"
	end if
	If err_str="" Then
		ip=userArr(0)
		If ip=0 Then ip=User_Ip
		conn.execute("insert into 74hu_pl (pl,ip,smsid,pltime)values('"&pl&"','"&ip&"',"&id&",'"&time_now&"')")
		if id<>0 then conn.execute("update 74hu_article Set smspin = smspin+1 where ID="&id)
		w "<onevent type='onenterforward'><go href='"&http_path&"discuss.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&"'/></onevent>"&_
			"<p align="""&wapconst&""">评论发表成功！<br/>"
	Else
		w "<p align="""&wapconst&""">"&err_str
	End If
	w "<a href='"&http_path&"discuss.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&"'>查看评论</a>"
	if id<>0 then w "<br/><a href='"&http_path&"article.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&"'>返回原文</a><br/>"
End Sub
' Wap2.0讨论页
Sub showsComment
	w "<title>发表评论</title>"
	Dim o,rs,id
	id=getN("id",1)
	Dim pl,p,pl_len,ip,err_str
	pl=getD("pl","")
	p=getN("p",1)
	pl_len=len(pl)
	err_str=""
	if pl_len=0 then err_str="评论内容不能为空！"
	if pl_len<numdiscuss*1 And err_str="" then err_str="评论内容最少"&numdiscuss&"字！"
	if pl_len>100 And err_str="" Then err_str="评论内容最多100字！"
	if id<>0 And err_str="" then
		if 0=conn.execute("select count(id) from 74hu_article where id="&id)(0) then err_str="评论文章不存在！"
		if 0<conn.execute("select count(id) from 74hu_pl where pl='"&pl&"' and smsid="&id)(0) then err_str="评论内容已存在！请不要重复提交"
	end if
	If err_str="" Then
		ip=userArr(0)
		If ip=0 Then ip=User_Ip
		conn.execute("insert into 74hu_pl (pl,ip,smsid,pltime)values('"&pl&"','"&ip&"',"&id&",'"&time_now&"')")
		if id<>0 then conn.execute("update 74hu_article Set smspin = smspin+1 where ID="&id)
		w "<meta http-equiv=""refresh"" content=""1;url="&http_path&"discuss.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&""">"&_
			"</head><body><div class=""main"">评论发表成功！<br/>"
	Else
		w "</head><body><div class=""main"">"&err_str
	End If
	w "<a href='"&http_path&"discuss.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&"'>查看评论</a>"
	if id<>0 then w "<br/><a href='"&http_path&"article.asp?id="&id&"&amp;p="&p&"&amp;"&a_sid&"'>返回原文</a><br/>"
End Sub
' Wap1.0留言页
Sub showGuest
	Dim p,act,rs,userid,name,sql,id
	id=getN("id",1)
	p=getN("p",1)
	if p<1 then p=1
	userid=userArr(0)
	act=request.QueryString("act")
	w "<card title=""客服留言"">"
	if act="view" then
		Dim rsn,rspr
		set rs=Server.CreateObject("ADODB.Recordset")
		rs.open"select * from 74hu_guest where ID=" & ID,conn,1,1
		w "<p align="""&wapconst&""">"
		checkMsg()'信息
		w "-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-<a href='"&http_path&"guest.asp?"&a_sid&"'>客服</a>-查看留言<br/><br/>"
		if rs.EOF then
			w "无此留言！<br/>"
		else
			name=nowml(rs("name"))
			id=rs("agent")
			If id<>"" And IsNumeric(id) Then name="<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"&name&"</a>"
			w "标题："&nowml(rs("title"))&"<br/>作者："&name&"<br/>时间：" & fordate(rs("HU_time")) & "<br/>----------<br/>"&nowml(rs("text"))&"<br/>"
			if rs("retext")<>"" then w "----------<br/>回复："&nowml(rs("retext"))&"<br/>时间："&fordate(rs("retime"))&"<br/>"
		end if
	elseif act="add" then
		Dim ss
		ss=getCheckCode
		w "<p align="""&wapconst&""">"
		checkMsg()'信息
		w "-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-<a href='"&http_path&"guest.asp?"&a_sid&"'>客服</a>-发表留言<br/><br/>"
		If userid=0 Then w "昵称：<br/><input name=""name"" type=""text"" format=""*M"" emptyok=""true"" maxlength=""10""/><br/>"
		w "标题：<br/><input name=""title"" type=""text"" format=""*M"" emptyok=""true"" maxlength=""20""/><br/>"&_
			"内容：<br/><input name=""text"" type=""text"" format=""*M"" emptyok=""true"" maxlength=""500""/><br/>"&_
			"联系方式(不公开)：<br/><input name=""lianxi"" type=""text"" format=""*M"" emptyok=""true"" maxlength=""50""/><br/>"&_
			"验证码："&ss&"<br/><input name=""num"" type=""text"" format=""*M"" emptyok=""true"" maxlength=""50""/><br/>"&_
			"<anchor>[提交留言]<go href="""&http_path&"guest.asp?act=save&amp;"&a_sid&""" method=""get"" accept-charset=""utf-8"">"&_
			"<postfield name=""name"" value=""$(name)""/>"&_
			"<postfield name=""title"" value=""$(title)""/>"&_
			"<postfield name=""text"" value=""$(text)""/>"&_
			"<postfield name=""lianxi"" value=""$(lianxi)""/>"&_
			"<postfield name=""open"" value=""$(open)""/>"&_
			"<postfield name=""num"" value=""$(num)""/>"&_
			"<postfield name=""num1"" value="""&numEncode(ss)&"""/>"&_
			"</go></anchor><br/>"
	elseif act="save" then
		Dim num,num1
		num=request.QueryString("num")
		num1=numDecode(request.QueryString("num1"))
		if num<>num1 then wn "<p align="""&wapconst&""">验证码错误,请返回重试！</p></card></wml>"
		Dim title,text,lianxi
		name=getD("name","")
		If userid<>0 Then name=userArr(1)'取当前用户名
		title=getD("title","")
		text=getD("text","")
		lianxi=getD("lianxi","")
		if name="" or title="" or text="" then wn "<p align="""&wapconst&""">昵称或标题内容不能为空！</p></card></wml>"
		w "<onevent type='onenterforward'><go href='"&http_path&"guest.asp?"&a_sid&"'/></onevent><p align="""&wapconst&""">"
		set rs=Server.CreateObject("ADODB.Recordset")
		rs.open"select * from 74hu_guest",conn,1,2
		rs.addnew
		rs("name")=name
		rs("title")=title
		rs("text")=text
		rs("HU_time")=time_now
		if lianxi<>"" then rs("lianxi")=lianxi
		If userid<>0 Then
			rs("agent")=userid
		Else
			rs("agent")=User_Ip
		End If
		rs.update
		rs.close
		set rs=Nothing
		w "发表成功，正在返回！<br/>"
	else
		w "<p align="""&wapconst&""">"
		checkMsg()'信息
		w "-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-客服首页<br/>"
		if wapguest =1  then w "<font color=""red"">注:新留言审核后显示</font><br/>"
		sql = "select * from 74hu_guest order by id desc"
		If wapguest=1 Then sql = "select * from 74hu_guest where retext<>'' order by id desc"
		set rs=Server.CreateObject("ADODB.Recordset")
		rs.open sql,conn,1,1
		If Not rs.eof Then
			Dim PageSize,Count,page,i,pagecount
			PageSize=10
			Count=rs.recordcount
			page=getN("page",1)
			page=int(page)
			if page<=0 or page="" then page=1
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			rs.move(pagesize*(page-1))
			w "<br/>共("&count&")条<a href="""&http_path&"guest.asp?act=add&amp;"&a_sid&""">留言</a><br/>"
			For i=1 To PageSize
				If rs.eof Then Exit For
				w "<a href='"&http_path&"guest.asp?act=view&amp;id="&rs("ID")&"&amp;p="&p&"&amp;"&a_sid&"'>"&i+(page-1)*PageSize&"."&nowml(rs("title"))&_
					"</a><br/>"
				id = rs("agent")
				If IsNumeric(id) Then
					w "[会员:<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"&nowml(rs("name"))&"</a>"
				Else
					w "[网友:"&nowml(rs("name"))
				End If
				if rs("retext")<>"" then
					w "/已回"
				else
					w "/未回"
				end if
				w "]<br/>"
				rs.moveNext
			Next
			w showPage("guest.asp", "", page, pagecount)
		Else
			w "还没有留言！<br/>"
		end if
		rs.close
		set rs=nothing
		w "<br/><a href="""&http_path&"guest.asp?act=add&amp;"&a_sid&""">我要发表留言</a><br/>"
	end if
End Sub
' Wap2.0留言页
Sub showsGuest
	Dim p,act,rs,userid,name,sql,id
	id=getN("id",1)
	p=getN("p",1)
	if p<1 then p=1
	userid=userArr(0)
	act=request.QueryString("act")
	w "<title>客服留言</title></head><body><div class=""main"">"
	checkMsg()'信息
	if act="view" then
		Dim rsn,rspr
		set rs=Server.CreateObject("ADODB.Recordset")
		rs.open"select * from 74hu_guest where ID=" & ID,conn,1,1
		w "<div class=""nav"">-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-<a href='"&http_path&"guest.asp?"&a_sid&"'>客服</a>-查看留言</div><br/>"
		if rs.EOF then
			w "无此留言！<br/>"
		else
			name=nowml(rs("name"))
			id=rs("agent")
			If id<>"" And IsNumeric(id) Then name="<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"&name&"</a>"
			w "标题："&nowml(rs("title"))&"<br/>作者："&name&"<br/>时间：" & fordate(rs("HU_time")) & "<br/>----------<br/>"&nowml(rs("text"))&"<br/>"
			if rs("retext")<>"" then w "----------<br/>回复："&nowml(rs("retext"))&"<br/>时间："&fordate(rs("retime"))&"<br/>"
		end if
	elseif act="add" then
		Dim ss
		ss=getCheckCode
		w "<div class=""nav"">-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-<a href='"&http_path&"guest.asp?"&a_sid&"'>客服</a>-发表留言</div><br/>"&_
		 "<form name=""guest"" action="""&http_path&""" method=""get"">"
		If userid=0 Then w "昵称：<br/><input name=""name"" type=""text"" /><br/>"
		w "标题：<br/><input name=""title"" type=""text""/><br/>内容：<br/><input name=""text"" type=""text"" /><br/>联系方式(不公开)：<br/>"&_
		 "<input name=""lianxi"" type=""text""/><br/>验证码："&ss&"<br/><input name=""num"" type=""text""/>"&_
		 "<input name=""aid"" type=""hidden"" value=""guest""/><input name=""act"" type=""hidden"" value=""save""/>"&_
		 "<input name=""num1"" type=""hidden"" value="""&numEncode(ss)&"""/><input name="""&bbssid&""" type=""hidden"" value="""&sid&"""/>"&_
		 "<br/><input type=""submit"" value=""提交留言""/></form>"
	elseif act="save" then
		Dim num,num1
		num=request.QueryString("num")
		num1=numDecode(request.QueryString("num1"))
		if num<>num1 then wn "验证码错误,请返回重试！</div></body></html>"
		Dim title,text,lianxi
		name=getD("name","")
		If userid<>0 Then name=userArr(1)'取当前用户名
		title=getD("title","")
		text=getD("text","")
		lianxi=getD("lianxi","")
		if name="" or title="" or text="" then wn "昵称或标题内容不能为空！</div></body></html>"
		set rs=Server.CreateObject("ADODB.Recordset")
		rs.open"select * from 74hu_guest",conn,1,2
		rs.addnew
		rs("name")=name
		rs("title")=title
		rs("text")=text
		rs("HU_time")=time_now
		if lianxi<>"" then rs("lianxi")=lianxi
		If userid<>0 Then
			rs("agent")=userid
		Else
			rs("agent")=User_Ip
		End If
		rs.update
		rs.close
		set rs=Nothing
		r ""&http_path&"guest.asp?"&a_sid&""
	else
		w "<div class=""nav"">-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-客服首页</div>"
		if wapguest =1  then w "<div class=""tip"">注:新留言审核后显示</div>"
		sql = "select * from 74hu_guest order by id desc"
		If wapguest=1 Then sql = "select * from 74hu_guest where retext<>'' order by id desc"
		set rs=Server.CreateObject("ADODB.Recordset")
		rs.open sql,conn,1,1
		If Not rs.eof Then
			Dim PageSize,Count,page,i,pagecount
			PageSize=10
			Count=rs.recordcount
			page=getN("page",1)
			page=int(page)
			if page<=0 or page="" then page=1
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			rs.move(pagesize*(page-1))
			w "<br/>共("&count&")条<a href="""&http_path&"guest.asp?act=add&amp;"&a_sid&""">留言</a><br/>"
			Dim class_
			For i=1 To PageSize
				If rs.eof Then Exit For
				w "<div class=""odd""><a href='"&http_path&"guest.asp?act=view&amp;id="&rs("ID")&"&amp;p="&p&"&amp;"&a_sid&"'>"&i+(page-1)*PageSize&"."&nowml(rs("title"))&"</a></div>"
				id = rs("agent")
				If IsNumeric(id) Then
					w "<div class=""even"">[会员:<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"&nowml(rs("name"))&"</a>"
				Else
					w "<div class=""even"">[网友:"&nowml(rs("name"))
				End If
				if rs("retext")<>"" then
					w "/已回"
				else
					w "/未回"
				end if
				w "]</div>"
				rs.moveNext
			Next
			w showsPage("guest.asp", "", page, pagecount) &"<br/>"
		Else
			w "还没有留言！<br/>"
		end if
		rs.close
		set rs=nothing
		w "<br/><a href="""&http_path&"guest.asp?act=add&amp;"&a_sid&""">我要发表留言</a><br/>"
	end if
End Sub
' Wap1.0公告页
Sub showReport
	Dim rs,id
	id=getN("id",1)
	IF  Request.QueryString("action")="view" Then
		w "<card id=""index"" title=""查看公告""><p align="""&wapconst&""">"
		checkMsg()'信息
		w "-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-<a href="""&http_path&"report.asp?"&a_sid&""">公告中心</a>-正文<br/>"
		Set rs=Server.CreateObject("Adodb.Recordset")
		rs.open "select * from 74hu_gonggao where id="&id&" order by id desc",conn,1,1
		If Not rs.eof Then
			w "标题:"&nowml(rs("name"))&"<br/>时间:"&fordate(rs("HU_time"))&"<br/>内容:"&ubbcode(rs("title"))&"<br/>"
		Else
			w "没有这个公告！"
		end if
		w "<br/><a href="""&http_path&"report.asp?"&a_sid&""">返回公告中心</a><br/>"
		Rs.close
		set Rs=nothing
	else
		w "<card title=""最新公告""><p align="""&wapconst&""">"
		checkMsg()'信息
		w "-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-公告中心<br/>"
		Set Rs = Server.CreateObject("Adodb.Recordset")
		Sql = "SELECT * FROM 74hu_gonggao order by id desc"
		Rs.Open Sql,conn,1,1
		If Not rs.eof Then
			Dim PageSize,i,Count,page,pagecount
			PageSize=10
			Count=rs.recordcount
			page=getN("page",1)
			if page<1 then page=1
			page=int(page)
			if page<=0 or page="" then page=1
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			rs.move(pagesize*(page-1))
			w "共("&count&")条公告<br/>"
			For i=1 To PageSize
				If rs.eof Then Exit For
				w "<a href="""&http_path&"report.asp?action=view&amp;id="&rs("id")&"&amp;"&a_sid&""">"&(i+(page-1)*PageSize)&"."&nowml(Rs("name"))&"</a><br/>"
				rs.moveNext
			Next
			w showPage("report.asp", "", page, pagecount)
		Else
			w "暂时没有公告！<br/>"
		end if
		Rs.close
		set Rs=nothing
	end if
End Sub
' Wap2.0公告页
Sub showsReport
	Dim rs,id
	id=getN("id",1)
	IF Request.QueryString("action")="view" Then
		w "<title>查看公告</title></head><body><div class=""main"">"
		checkMsg()'信息
		w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-<a href="""&http_path&"report.asp?"&a_sid&""">公告</a>-正文</div>"
		Set rs=Server.CreateObject("Adodb.Recordset")
		rs.open "select  * from 74hu_gonggao where id="&id&" order by id desc",conn,1,1
		If Not rs.eof Then
			w "<div class=""tle"">"&nowml(rs("name"))&"</div>["&fordate(rs("HU_time"))&"]<br/>"&ubbcode(rs("title"))&"<br/>"
		Else
			w "没有这个公告！"
		end if
		w "<br/><a href="""&http_path&"report.asp?"&a_sid&""">返回公告中心</a><br/>"
		Rs.close
		set Rs=nothing
	else
		w "<title>最新公告</title></head><body><div class=""main"">"
		checkMsg()'信息
		Set Rs = Server.CreateObject("Adodb.Recordset")
		Sql = "SELECT * FROM 74hu_gonggao order by id desc"
		Rs.Open Sql,conn,1,1
		If Not rs.eof Then
			Dim PageSize,Count,page,i,pagecount
			PageSize=10
			Count=rs.recordcount
			page=getN("page",1)
			if page<1 then page=1
			page=int(page)
			if page<=0 or page="" then page=1
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			rs.move(pagesize*(page-1))
			w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-公告中心</div>共("&count&")条公告<br/>"
			Dim class_
			For i=1 To PageSize
				If rs.eof Then Exit For
				If i mod 2 = 0 Then
					class_="even"
				Else
					class_="odd"
				End If
				w "<div class="""&class_&"""><a href="""&http_path&"report.asp?action=view&amp;id="&rs("id")&"&amp;"&a_sid&""">"&(i+(page-1)*PageSize)&"."&nowml(Rs("name"))&"</a></div>"
				rs.moveNext
			Next
			w showsPage("report.asp", "", page, pagecount)&"<br/>"
		Else
			w "暂时没有公告！<br/>"
		end if
		Rs.close
		set Rs=nothing
	end if
End Sub
' wap1.0列表页
Sub showList
	Dim act,rs,hit,tpl,list,ad2txt,ad3txt,rndtxt,id
	id=getN("id",1)
	act=request.QueryString("act")
	tpl=ubbcode(tpllist)
	if act<>"" then
		w "<card title='站内排行榜'><p align="""&wapconst&"""><a id=""top"" name=""top""></a>"
		checkMsg()'信息
		if act="top" then
			w "-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-站内排行-<a href='"&http_path&"list.asp?act=new&amp;"&a_sid&"'>最新</a><br/>"
		else
			w "-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-站内最新-<a href='"&http_path&"list.asp?act=top&amp;"&a_sid&"'>排行</a><br/>"
		end if
	else
		Set rs = Server.CreateObject("ADODB.Recordset")
		sql="Select class from 74hu_list where classid="&id
		rs.open sql,conn,3,1
		if rs.eof then
			rs.close
			set rs=Nothing
			r ""&http_path&"?aid=index&"&a_sid&""
		end if
		Dim classname,sql,PageSize,Count,page,i,pagecount
		classname=rs("class")
		rs.close
		set rs=Nothing
		w "<card title='"&classname&"-"&waptitle&"'><p align="""&wapconst&""">"
		checkMsg()'信息
		w "-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-"&classname&"-<a href='"&http_path&"list.asp?act=top&amp;"&a_sid&"'>排行</a><br/>"
	end if
	Set rs = Server.CreateObject("ADODB.Recordset")
	if act<>"" then
		if act="top" then
			sql="Select top 100 id,title,hit from 74hu_article where classid<>0 order by hit*1000+id desc"
		else
			sql="Select top 100 id,title,hit from 74hu_article where classid<>0 order by id desc"
		end if
	else
		sql="Select id,title,hit from 74hu_article where classid="&id&" order by id desc"
	end if
	rs.open sql,conn,3,1
	If Not rs.eof then
		ad2txt=getAD(2,1)
		PageSize=numlist
		Count=rs.recordcount
		page=getN("page",1)
		if page<=0 or page="" then page=1
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		rs.move(pagesize*(page-1))
		For i=1 To PageSize
			If rs.eof Then Exit For
			If waphits=1 Then hit="["&rs("hit")&"阅]"
			list=list& "<a href='"&http_path&"article.asp?id="&rs("id")&"&amp;"&a_sid&"'>"&i+(page-1)*PageSize&"."&nowml(rs("title"))&"</a>"&hit&"<br/>"
			rs.moveNext
		Next
		list=list& showPage("list.asp", "act:"&act&",id:"&id, page, pagecount)
		rndtxt=getArticle(id,4,3)
		ad3txt=getAD(3,1)
	Else
		list= "暂时没有文章！<br/>"
	end if
	rs.close
	set rs=nothing
	Dim rndnum
	rndnum=time_r'要避免内容中有{}标签,需将{}转义
	tpl=Replace(tpl,"{","{_74hu_"&rndnum)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"ad2}",ad2txt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"ad3}",ad3txt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"rnd}",rndtxt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"list}",list,1,1)
	w tpl
End Sub
' wap2.0列表页
Sub showsList
	Dim act,rs,hit,tpl,list,ad2txt,ad3txt,rndtxt,id
	id=getN("id",1)
	act=request.QueryString("act")
	tpl=ubbcode(tpllist)
	if act<>"" then
		w "<title>站内排行榜</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
		checkMsg()'信息
		if act="top" then
			w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-站内排行-<a href="""&http_path&"list.asp?act=new&amp;"&a_sid&""">最新</a></div>"
		else
			w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-站内最新-<a href="""&http_path&"list.asp?act=top&amp;"&a_sid&""">排行</a></div>"
		end if
	else
		Set rs = Server.CreateObject("ADODB.Recordset")
		sql="Select class from 74hu_list where classid="&id
		rs.open sql,conn,3,1
		if rs.eof then
			rs.close
			set rs=Nothing
			r ""&http_path&"?aid=index"
		end if
		Dim classname,sql
		classname=rs("class")
		rs.close
		set rs=Nothing
		w "<title>"&classname&"-"&waptitle&"</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
		checkMsg()'信息
		w  "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-"&classname&"-<a href='"&http_path&"list.asp?act=top&amp;"&a_sid&"'>排行</a></div>"
	end if
	Set rs = Server.CreateObject("ADODB.Recordset")
	if act<>"" then
		if act="top" then
			sql="Select top 100 id,title,hit from 74hu_article where classid<>0 order by hit*1000+id desc"
		else
			sql="Select top 100 id,title,hit from 74hu_article where classid<>0 order by id desc"
		end if
	else
		sql="Select id,title,hit from 74hu_article where classid="&id&" order by id desc"
	end if
	rs.open sql,conn,3,1
	If Not rs.eof then
		ad2txt=getAD(2,1)
		Dim PageSize,Count,page,i,pagecount,class_
		PageSize=numlist
		Count=rs.recordcount
		page=getN("page",1)
		if page<=0 or page="" then page=1
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		rs.move(pagesize*(page-1))
		For i=1 To PageSize
			If rs.eof Then Exit For
			If waphits=1 Then hit="["&rs("hit")&"阅]"
			If (i mod 2)=0 Then
				class_="even"
			Else
				class_="odd"
			End If
			list=list& "<div class="""&class_&"""><a href='"&http_path&"article.asp?id="&rs("id")&"&amp;"&a_sid&"'>"&i+(page-1)*PageSize&"."&nowml(rs("title"))&"</a>"&hit&"</div>"
			rs.moveNext
		Next
		list=list& showsPage("list.asp", "act:"&act&",id:"&id, page, pagecount)
		rndtxt=getArticle(id,4,3)
		ad3txt=getAD(3,1)
	Else
		list="暂时没有文章！<br/>"
	end if
	rs.close
	set rs=nothing
	Dim rndnum
	rndnum=time_r'要避免内容中有{}标签,需将{}转义
	tpl=Replace(tpl,"{","{_74hu_"&rndnum)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"ad2}",ad2txt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"ad3}",ad3txt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"rnd}",rndtxt,1,1)
	tpl=Replace(tpl,"{_74hu_"&rndnum&"list}",list,1,1)
	w tpl
End Sub
' Wap1.0地图页
Sub showMap
	Dim rs,sql
	w "<card title="""&waptitle&"网站地图""><p align="""&wapconst&""">"
	checkMsg()'信息
	Set rs = Server.CreateObject("ADODB.Recordset")
	sql="Select classid,class from 74hu_list"
	rs.open sql,conn,1,1
	if not rs.eof then
		Dim i
		For i=1 to rs.recordcount
			w "<a href="""&http_path&"list.asp?id="&rs("classid")&"&amp;"&a_sid&""">"&i&"."&rs("class")&"</a><br/>"
			rs.moveNext
		Next
		rs.close
		set rs=nothing
	else
		w "暂时没有<br/> "
	end if
End Sub
' Wap2.0地图页
Sub showsMap
	Dim rs
	w "<title>"&waptitle&"网站地图</title></head><body><div class=""main"">"
	checkMsg()'信息
	w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-网站地图</div>"
	Set rs = Server.CreateObject("ADODB.Recordset")
	sql="Select classid,class from 74hu_list"
	rs.open sql,conn,1,1
	if not rs.eof then
		Dim i,class_
		For i=1 to rs.recordcount
			If (i mod 2)=0 Then
				class_="even"
			Else
				class_="odd"
			End If
			w "<div class="""&class_&"""><a href="""&http_path&"list.asp?id="&rs("classid")&"&amp;"&a_sid&""">"&i&"."&rs("class")&"</a></div>"
			rs.moveNext
		Next
		rs.close
		set rs=nothing
	else
		w "暂时没有<br/> "
	end if
End Sub
' Wap1.0书签页
Sub showBookmark
	w "<card title=""保存书签""><p align="""&wapconst&""">"
	checkMsg()'信息
	w "-<a href='"&http_path&"?aid=index&amp;"&a_sid&"'>首页</a>-收藏本站<br/>"&_
		"您可以按以下步骤收藏本站。<br/><br/><b>诺基亚</b>:选项-存为书签(添加书签)-确认-操作-增加书签<br/>"&_
		"<b>iPhone</b>:轻按页面下方的+按钮，选择添加书签。存储书签后，点击确定即可<br/>"&_
		"<b>微软</b>:选择收藏夹-添加/删除-添加-确定<br/>"&_
		"<b>摩托罗拉</b>:菜单键-书签-标记站点-保存 <br/><b>索爱</b>:更多-书签-添加书签-确定<br/>"&_
		"<b>三星</b>:上网键-收藏夹-选择一个空的收藏夹地址-确认url地址-输入"""&waptitle&""" <br/>"&_
		"<b>松下</b>:选择页面左上角的菜单-书签-标记站点-保存 <br/><b>西门子</b>:上网键-收藏夹-储存 <br/>"&_
		"<b>NEC</b>:菜单-书签-标记站点-保存 <br/><b>LG</b>:菜单-书签-标记站点-保存 <br/>"&_
		"<b>三菱</b>:按左功能键-书签-添加新书签-保存 <br/><b>海尔</b>:网页浏览状态下长按*键-书签-新建-编辑-输入"""&_
		waptitle&"""-保存 <br/><b>夏新</b>:访问网站时选中页面左上角-书签-保存 <br/><b>联想</b>:网络-输入网址-输入"""&_
		waptitle&"""-保存 <br/><b>东信</b>:选项-保存书签 <br/><b>CECT</b>:菜单-保存书签-保存<br/>"&_
		"<b>天语</b>:菜单-选项-书签-保存书签<br/><b>波导</b>:功能表-互联网-书签-选项-确定<br/>"
End Sub
' Wap2.0书签页
Sub showsBookmark
	w "<title>保存书签</title></head><body><div class=""main"">"
	checkMsg()'信息
	w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-收藏本站</div>"&_
		"您可以按以下步骤收藏本站。<br/><div class=""odd""><b>诺基亚</b>:选项-存为书签(添加书签)-确认-操作-增加书签<br/>"&_
		"<b>iPhone</b>:轻按页面下方的+按钮，选择添加书签。存储书签后，点击确定即可<br/>"&_
		"<b>微软</b>:选择收藏夹-添加/删除-添加-确定<br/>"&_
		"<b>摩托罗拉</b>:菜单键-书签-标记站点-保存 <br/><b>索爱</b>:更多-书签-添加书签-确定<br/>"&_
		"<b>三星</b>:上网键-收藏夹-选择一个空的收藏夹地址-确认url地址-输入"""&waptitle&""" <br/>"&_
		"<b>松下</b>:选择页面左上角的菜单-书签-标记站点-保存 <br/><b>西门子</b>:上网键-收藏夹-储存 <br/>"&_
		"<b>NEC</b>:菜单-书签-标记站点-保存 <br/><b>LG</b>:菜单-书签-标记站点-保存 <br/>"&_
		"<b>三菱</b>:按左功能键-书签-添加新书签-保存 <br/><b>海尔</b>:网页浏览状态下长按*键-书签-新建-编辑-输入"""&_
		waptitle&"""-保存 <br/><b>夏新</b>:访问网站时选中页面左上角-书签-保存 <br/><b>联想</b>:网络-输入网址-输入"""&_
		waptitle&"""-保存 <br/><b>东信</b>:选项-保存书签 <br/><b>CECT</b>:菜单-保存书签-保存<br/>"&_
		"<b>天语</b>:菜单-选项-书签-保存书签<br/><b>波导</b>:功能表-互联网-书签-选项-确定<br/>"&_
		"<b>IE</b>:右键-添加到收藏夹-确定<br/><b>火狐</b>:右键-将此页加为书签-完成<br/>"&_
		"<b>Chrome</b>:点击地址栏旁边的星号<br/><b>Opera</b>:右键-将页面加入书签-确定</div>"
End Sub
' Wap1.0 链接页
Sub showUrl
	Dim rs
	set rs=Server.CreateObject("ADODB.Recordset")
	rs.open"select id,url from 74hu_gogo Where id="&id,conn,1,1
	if not (rs.bof and rs.eof) then
		Dim tid,url
		tid=rs("id")
		url=noubburl(rs("url"))
		conn.Execute("update 74hu_gogo set tid=tid+1 Where id=" & tid)
	else
		url=""&http_path&"?aid=index&amp;"&a_sid&""
	end if
	rs.close
	set rs=nothing
	w "<card title='正在进入...'><onevent type='onenterforward'><go href='"&noubburl(url)&"'/></onevent>"&_
		"<p align=""left"" mode=""wrap"">如果网页没有自动跳转，请点击<a href="""&nowml(url)&""">快速进入</a><br/>"
End Sub
' Wap2.0 链接页
Sub showsUrl
	Dim rs
	set rs=Server.CreateObject("ADODB.Recordset")
	rs.open"select id,url from 74hu_gogo Where id="&id,conn,1,1
	if not (rs.bof and rs.eof) then
		Dim tid,url
		tid=rs("id")
		url=noubburl(rs("url"))
		conn.Execute("update 74hu_gogo set tid=tid+1 Where id=" & tid)
	else
		url=""&http_path&"?aid=index&"&a_sid&""
	end if
	rs.close
	set rs=nothing
	r nourl(url)
End Sub
' Wap1.0友链页
Sub showLink
	Dim act,rs,sql,rss,sqll,linknum,linkactive,active,linkindex,links,id
	Dim PageSize,Count,page,i,pagecount
	id=getN("id",1)
	linknum=2'简称字数
	linkactive=10'无连入自动隐藏天数
	active=1'审核方式
	linkindex=0'排版
	links=0'跳转方式
	Set Rs=server.createobject("adodb.recordset")
	sql="select iif(linknum>4,4,linknum) as linknum,linkactive,active,linkindex,links from 74hu_ad where id=1"
	Rs.open sql,conn,1,1
	if Not rs.eof Then
		linknum=rs("linknum")
		linkactive=rs("linkactive")
		active=rs("active")
		linkindex=rs("linkindex")
		links=rs("links")
	end if
	rs.close
	act=request.QueryString("act")
	if act="" then
		w "<card title=""友情链接""><p align="""&wapconst&""">----动态友链----<br/>"
		Sql="select ID,name,classid from 74hu_link Where active=0 and del=0 and datediff('d', HU_time, '"&time_now&"')<"&linkactive&" order by HU_time desc"
		rs.open Sql,conn,1,1
		If Not rs.eof	Then
			PageSize=30
			Count=rs.recordcount
			page=getN("page",1)
			if page<=0 then page=1
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			rs.move(pagesize*(page-1))
			For i=1 To PageSize
				If rs.eof Then Exit For
				w "<a href="""&http_path&"link.asp?act=view&amp;id="&rs("id")&"&amp;class="&rs("classid")&"&amp;"&a_sid&""">"&nowml(rs("name"))&"</a><br/>"
				rs.moveNext
			Next
			w showPage("link.asp", "", page, pagecount)
		Else
			w "暂时没有友链！<br/>"
		end if
		rs.close
		w "----网站分类----<br/>"
		if linkindex=0 then
			sql="select classid,class from 74hu_linkc order by pid asc"
			rs.open sql,conn,1,1
			if rs.eof then
				w "暂无分类<br/>"
			else
				i=1
				do while not rs.eof
					set Rss=Server.CreateObject("ADODB.Recordset")
					rss.open "select top 4 ID,namt,classid from 74hu_link Where Active=0 and del=0 and classid="&rs("classid")&" order by HU_time desc",conn,1,1
					w "【<a href="""&http_path&"link.asp?act=list&amp;class="&rs("classid")&"&amp;"&a_sid&""">"&nowml(rs("Class"))&"</a>】"
					If rss.eof then
						w "暂时还没有<br/>"& chr(13)
					Else
						for i=1 to 6
							if rss.EOF then Exit for
							w "<a href='"&http_path&"link.asp?act=view&amp;class="&rss("classid")&"&amp;id="&rss("id")&"&amp;"&a_sid&"'>"&nowml(rss("namt"))&"</a> "
							rss.Movenext
						Next
						w "<br/>"
					End if
					rss.close
					set rss=nothing
					i=i+1
					rs.movenext
				loop
			end if
			rs.close
			set rs=nothing
		else
			sql="select br,classid,class from 74hu_linkc order by pid asc"
			rs.open sql,conn,1,1
			if not (rs.bof and rs.eof)  then
				For i=1 to rs.RecordCount
					If Rs.Eof Then exit For
					Dim br
					if rs("br")="1" then
						br="<br/>"
					else
						br=""
					end if
					w "<a href="""&http_path&"link.asp?act=list&amp;class="&rs("classid")&"&amp;"&a_sid&""">"&nowml(rs("class"))&"</a> "& br &""
					Rs.MoveNext
				Next
			end if
			rs.close
			set rs=nothing
		end if
		w "<a href='"&http_path&"link.asp?act=add&amp;"&a_sid&"'>&gt;&gt;友链合作申请</a><br/><a href='"&http_path&"link.asp?act=wait&amp;"&a_sid&"'>待审网站</a>"&_
			"-<a href='"&http_path&"link.asp?act=query&amp;"&a_sid&"'>查找回链</a>"
	elseif act="go" then
		Dim yourip,sss,ips,cache_ip,one_ip,all_s,k_ip,i_ip,del_time,ip_time,temp_s
		' On Error Resume Next
		Server.ScriptTimeOut=9999999
		yourip=Request.ServerVariables("HTTP_X_UP_CALLING_LINE_ID")
		if yourip="" then yourip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
		if yourip="" then yourip=Request.ServerVariables("REMOTE_ADDR")
		sss=180
		ips=500
		cache_ip=Application("cache_ip")
		if cache_ip="" then cache_ip="|"
		one_ip=split(cache_ip,"|")
		all_s=ubound(one_ip)
		for k_ip=0 to all_s
			if yourip=one_ip(k_ip) then
				i_ip=k_ip:ip_time=one_ip(k_ip+1):Exit for
			else
				i_ip=0:ip_time="2000-10-10 10:10:10"
			end if
		next
		del_time=DATEDIFF("s",ip_time,time_now)
		if i_ip<all_s and sss>del_time then r ""&http_path&"?aid=index"
		if all_s>ips*2 Then
			Application.Lock
			Application("cache_ip")="|"
			Application.UnLock
		else
			if i_ip=0 then
				temp_s=cache_ip&yourip&"|"&time_now&"|"
			else
				Dim text_1,num_1,num_2,num_3,num_4,text_2,text_3,text_4
				text_1="|"&yourip&"|"&ip_time&"|"
				num_1=len(cache_ip)
				num_2=len(text_1)
				num_3=instr(cache_ip,text_1)
				num_4=num_1-num_2-num_3+1
				text_2=left(cache_ip,num_3)
				text_3=right(cache_ip,num_4)
				text_4=yourip&"|"&time_now&"|"
				temp_s=text_2&text_4&text_3
			end if
			Application.Lock
			Application("cache_ip")=temp_s
			Application.UnLock
		end if
		Sql="select ID,HU_in,HU_time from 74hu_link Where ID="&ID
		Rs.open Sql,conn,1,3
		Rs("HU_in")=Rs("HU_in")+1
		Rs("HU_time")=time_now
		Rs.update()
		rs.close
		set rs=nothing
		r ""&http_path&"?aid=index"
	elseif act="view" then
		Sql="select * from 74hu_link Where id="&id
		Rs.open Sql,conn,1,3
		If Not rs.eof Then
			Rs("HU_out")=Rs("HU_out")+1
			Rs("OUTtime")=time_now
			Rs.update()
		Else
			r ""&http_path&"?aid=index"
		End If
		If links=0 Then
			w "<card title='"&nowml(rs("name"))&"' ontimer='"&noubburl(rs("url"))&"'><timer value='3'/><p align="""&wapconst&""">"&_
				"正在跳转到“"&nowml(rs("name"))&"”,<br/>请稍候...<a href='"&noubburl(rs("url"))&"'>快速进入</a><br/>"&_
				"网站介绍："&nowml(rs("jian"))&"<br/>回链：http://"&wapurl&"/link.asp?act=go&amp;id="&rs("id")&"<br/><br/>"
		Else
			r nourl(rs("url"))
		End If
		rs.close
		set rs=nothing
	elseif act="post" then
		Dim classid,name,namt,url,jian
		classid=Request.QueryString("classid")
		name=getD("name","")
		namt=getD("namt","")
		url=LCase(getD("url",""))
		jian=getD("jian","")
		if session("name")=1 then
			wn "<card title=""重复申请""><p align="""&wapconst&""">你刚才已申请过了！请不要重复申请！<br/>"
		else
			if name="" or namt="" or url="" or jian="" or classid="" or isnumeric(classid)=false then
				wn "<card title=""出错了吧""><p align="""&wapconst&""">各项都要填写,不能为空！<br/>"
			else
				Sql="select * from 74hu_link"
				RS.open sql,conn,1,3
				RS.addnew
				RS("name")=name
				RS("namt")=namt
				RS("url")=url
				RS("classid")=classid
				RS("jian")=jian
				RS("active")=active
				RS.update
				session.timeout=1
				session("name")=1
			end if
		end if
		w "<card title='申请友链成功' ontimer='"&http_path&"link.asp?act=you&amp;"&a_sid&"'><timer value='1'/><p align="""&wapconst&""">申请友链成功<br/>"
		rs.close
		set rs=nothing
	elseif act="list" then
		Dim add
		add=request.QueryString("class")
		if add="" or IsNumeric(add)=false then
			r ""&http_path&"?aid=index"
		else
			Set rss=Server.CreateObject("ADODB.Recordset")
			sqll="Select class from 74hu_linkc where classid="&add
			rss.open sqll,conn,1,1
			if not rss.eof then
				Dim classname
				classname=rss("class")
			end if
			rss.close
			set rss=nothing
			w "<card title="""&classname&"网站""><p align="""&wapconst&""">=" &classname&"网站=<br/>"
			sql="Select classid,id,name from 74hu_link where classid="&add&" And Active=0 and del=0 order by HU_time desc"
			rs.open sql,conn,1,1
			If Not rs.eof Then
				PageSize=15
				Count=rs.recordcount
				page=getN("page",1)
				if page<=0 then page=1
				pagecount=(count+pagesize-1)\pagesize
				if page>pagecount then page=pagecount
				rs.move(pagesize*(page-1))
				For i=1 To PageSize
					If rs.eof Then Exit For
					w ""&i+(page-1)*PageSize&".<a href="""&http_path&"link.asp?act=view&amp;class="&rs("classid")&"&amp;id="&rs("id")&"&amp;"&a_sid&""">"&nowml(rs("name"))&"</a><br/>"
					rs.moveNext
				Next
				w showPage("link.asp", "act:list,class:"&add, page, pagecount)
			Else
				w "暂时没有添加！<br/>"
			end if
			w "<a href='"&http_path&"link.asp?"&a_sid&"'>返回友链首页</a><br/>"
			rs.close
			set rs=nothing
		end if
	elseif act="you" then
		w "<card title=""申请友链成功""><p align="""&wapconst&""">"
		Sql="select top 1 id from 74hu_link order by id desc"
		RS.open Sql,conn,1,1
		w "添加友链地址成功，"
		if Active=1 then
			w "请等待站长审核，审核通过后才会显示<br/>"
		else
			w "你的友链已经显示出来!<br/>"
		End if
		w "贵站返回我站的链接地址是:http://"&wapurl&"/link.asp?act=go&amp;id="&Rs("id")&"<br/>网站名称:"&waptitle&"<br/>"&_
			"<a href='"&http_path&"link.asp?"&a_sid&"'>返回友链首页</a><br/>"
		rs.close
		set rs=nothing
	elseif act="add" then
		
		w "<card title=""申请友链""><p align="""&wapconst&""">"&_
			"网站名称:(3-6字)<br/><input type=""text"" name=""name"&Time_r&""" maxlength=""7"" value=""""/><br/>"&_
			"网站简称:("&linknum&"字)<br/><input type=""text"" name=""namt"&Time_r&""" maxlength="""&linknum&""" value=""""/><br/>"&_
			"网址:(需http://)<br/><input type=""text"" name=""url"&Time_r&""" value=""http://""/><br/>"&_
			"网站分类：<select name=""classid"&Time_r&""">"
		sql = "select classid,class from 74hu_linkc"
		Rs.open sql,conn,1,1
		do while not Rs.eof
			w "<option value='"&rs("classid")&"'>"&rs("class")&"</option>"
			rs.movenext
		Loop
		rs.close
		set rs=nothing
		w "</select><br/>"&_
			"网站简介：(50字内)<br/><input type=""text"" name=""jian"&Time_r&""" title=""简介""  value=""暂时没有介绍…"" maxlength=""100""/><br/>"&_
			"<anchor>确定提交<go href="""&http_path&"link.asp?act=post&amp;"&a_sid&""" method=""get"" accept-charset=""utf-8"">"&_
			"<postfield name=""name"" value=""$(name"&Time_r&")""/>"&_
			"<postfield name=""namt"" value=""$(namt"&Time_r&")""/>"&_
			"<postfield name=""url"" value=""$(url"&Time_r&")""/>"&_
			"<postfield name=""classid"" value=""$(classid"&Time_r&")""/>"&_
			"<postfield name=""jian"" value=""$(jian"&Time_r&")""/>"&_
			"</go></anchor><br/>"&_
			"<br/>欢迎优秀WAP网站交换链接。"&_
			"<br/>1.合作原则:流量互补,双赢发展,"&linkactive&"天没流量首页自动隐藏。"&_
			"<br/>2.流程: "&_
			"<br/>1)提交网站，获取链接地址; "&_
			"<br/>2)将我站的链接放到贵站明显位置。"&_
			"<br/>3)我站人员3个工作日内审核网站，合适网站即可收录。"&_
			"<br/>"&_
			"<br/>申请友情链接前请先在您的网站上做好本站的链接："&_
			"<br/>网站名称："&waptitle&_
			"<br/>做好我站链接后，我们会及时进行审核。<br/>"&_
			"<a href='"&http_path&"link.asp?"&a_sid&"'>返回友链首页</a><br/>"
	elseif act="wait" then'待审
		w "<card title=""待审友链""><p align="""&wapconst&""">-<a href='"&http_path&"?"&a_sid&"'>首页</a>-<a href='"&http_path&"link.asp?"&a_sid&"'>友链</a>-待审友链<br/>"
		sql="Select classid,id,name from 74hu_link where Active=1 and del=0 order by HU_time desc"
		rs.open sql,conn,1,1
		If Not rs.eof Then
			PageSize=15
			Count=rs.recordcount
			page=getN("page",1)
			if page<=0 then page=1
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			rs.move(pagesize*(page-1))
			For i=1 To PageSize
				If rs.eof Then Exit For
				w ""&i+(page-1)*PageSize&"."&nowml(rs("name"))&"<br/>"
				rs.moveNext
			Next
			w showPage("link.asp", "act:wait", page, pagecount)
		Else
			w "暂时没有待审网站！<br/>"
		end if
		w "<a href='"&http_path&"link.asp?"&a_sid&"'>返回友链首页</a><br/>"
		rs.close
		set rs=nothing
	elseIf act="query" then'查回链
		a=getDD("a","")
		lnk=getD("link","")
		w "<card title=""查找回链""><p align="""&wapconst&""">-<a href='"&http_path&"?"&a_sid&"'>首页</a>-<a href='"&http_path&"link.asp?"&a_sid&"'>友链</a>-查找回链<br/>"
		If a="" Then
			w "网址:<input name=""link"&time_r&"""/><br/><anchor><go href="""&http_path&"link.asp?"&a_sid&"&amp;act=query&amp;a=1"" method=""post"">查找回链"&_
				"<postfield name=""link"" value=""$(link"&time_r&")""/></go></anchor>"
		Else
			If lnk="" Then
				w "网站不能为空"
			Else
				Set rs=Server.CreateObject("ADODB.Recordset")
				rs.open "select top 1 id,url,name,active from 74hu_link where url like '%" & lnk & "%'",conn,1,1
				If Not rs.eof Then
					w "网址:"&nowml(rs("url"))&"<br/>站名:"&nowml(rs("name"))&"<br/>回链:http://"&wapurl&"/link.asp?act=go&amp;id="&Rs("id")&"<br/>状态:"
					If rs("active")=1 Then
						w "未审核"
					Else
						w "已审核"
					End If
				Else
					w "没有这个网站!"
				End If
				rs.close
				Set rs=Nothing
			End If
		End If
	else
		w "<a href='"&http_path&"link.asp?"&a_sid&"'>返回友链首页</a><br/>"
	end if
End Sub
' Wap2.0友链页
Sub showsLink
	Dim act,rs,sql,rss,sqll,linknum,linkactive,active,linkindex,links,class_,id
	Dim PageSize,Count,page,i,pagecount
	id=getN("id",1)
	linknum=2'简称字数
	linkactive=10'无连入自动隐藏天数
	active=1'审核方式
	linkindex=0'排版
	links=0'跳转方式
	Set Rs=server.createobject("adodb.recordset")
	sql="select iif(linknum>4,4,linknum) as linknum,linkactive,active,linkindex,links from 74hu_ad where id=1"
	Rs.open sql,conn,1,1
	if Not rs.eof Then
		linknum=rs("linknum")
		linkactive=rs("linkactive")
		active=rs("active")
		linkindex=rs("linkindex")
		links=rs("links")
	end if
	rs.close
	act=request.QueryString("act")
	if act="" then
		Dim getday,linkverify
		w "<title>友情链接</title></head><body><div class=""main""><div class=""nav"">※动态友链:</div>"
		Sql="select ID,name,classid from 74hu_link Where active=0 and del=0 and datediff('d', HU_time, '"&time_now&"')<"&linkactive&" order by HU_time desc"
		rs.open Sql,conn,1,1
		If Not rs.eof Then
			PageSize=30
			Count=rs.recordcount
			page=getN("page",1)
			if page<=0 then page=1
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			rs.move(pagesize*(page-1))
			For i=1 To PageSize
				If rs.eof Then Exit For
				If i Mod 2 = 0 Then
					class_="even"
				Else
					class_="odd"
				End If
				w "<div class="""&class_&""">"&i+(page-1)*PageSize&".<a href="""&http_path&"link.asp?act=view&amp;id="&rs("id")&"&amp;class="&rs("classid")&"&amp;"&a_sid&""">"&nowml(rs("name"))&"</a></div>"
				rs.moveNext
			Next
			w showsPage("link.asp", "", page, pagecount)&"<br/>"
		Else
			w "暂时没有友链！<br/>"
		end if
		rs.close
		w "<div class=""nav"">※网站分类:</div>"
		if linkindex=0 then
			rs.open "select * from 74hu_linkc order by pid asc",conn,1,1
			if rs.eof then
				w "暂无分类<br/>"
			else
				i=1
				do while not rs.eof
					set Rss=Server.CreateObject("ADODB.Recordset")
					rss.open "select top 4 ID,namt,classid from 74hu_link Where Active=0 and del=0 and classid="&rs("classid")&" order by HU_time desc",conn,1,1
					w "【<a href="""&http_path&"link.asp?act=list&amp;class="&rs("classid")&"&amp;"&a_sid&""">"&nowml(rs("Class"))&"</a>】"
					If rss.eof then
						w "暂时还没有<br/>"
					Else
						for i=1 to 6
							if rss.EOF then Exit for
							w "<a href='"&http_path&"link.asp?act=view&amp;class="&rss("classid")&"&amp;id="&rss("id")&"&amp;"&a_sid&"'>"&nowml(rss("namt"))&"</a> "
							rss.Movenext
						Next
						w "<br/>"
					End if
					rss.close
					set rss=nothing
					i=i+1
					rs.movenext
				loop
			end if
			rs.close
			set rs=nothing
		else
			sql="select br,classid,class from 74hu_linkc order by pid asc"
			rs.open sql,conn,1,1
			if not (rs.bof and rs.eof)  then
				For i=1 to rs.RecordCount
					If Rs.Eof Then exit For
					Dim br
					if rs("br")="1" then
						br="<br/>"
					else
						br=""
					end if
					w "<a href="""&http_path&"link.asp?act=list&amp;class="&rs("classid")&"&amp;"&a_sid&""">"&nowml(rs("class"))&"</a> "& br &""
					Rs.MoveNext
				Next
			end if
			rs.close
			set rs=nothing
		end if
		w "<a href='"&http_path&"link.asp?act=add&amp;"&a_sid&"'>&gt;&gt;友链合作申请</a><br/><a href='"&http_path&"link.asp?act=wait&amp;"&a_sid&"'>待审网站</a>"&_
			"-<a href='"&http_path&"link.asp?act=query&amp;"&a_sid&"'>查找回链</a>"
	elseif act="go" then
		' On Error Resume Next
		Dim yourip,sss,ips,cache_ip,one_ip,all_s,k_ip,i_ip,del_time,ip_time,temp_s
		Server.ScriptTimeOut=9999999
		yourip=Request.ServerVariables("HTTP_X_UP_CALLING_LINE_ID")
		if yourip="" then yourip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
		if yourip="" then yourip=Request.ServerVariables("REMOTE_ADDR")
		sss=180
		ips=500
		cache_ip=Application("cache_ip")
		if cache_ip="" then cache_ip="|"
		one_ip=split(cache_ip,"|")
		all_s=ubound(one_ip)
		for k_ip=0 to all_s
			if yourip=one_ip(k_ip) then
				i_ip=k_ip:ip_time=one_ip(k_ip+1):Exit for
			else
				i_ip=0:ip_time="2000-10-10 10:10:10"
			end if
		next
		del_time=DATEDIFF("s",ip_time,time_now)
		if i_ip<all_s and sss>del_time then r ""&http_path&"?aid=index"
		if all_s>ips*2 Then
			Application.Lock
			Application("cache_ip")="|"
			Application.UnLock
		else
			if i_ip=0 then
				temp_s=cache_ip&yourip&"|"&time_now&"|"
			else
				Dim text_1,num_1,num_2,num_3,num_4,text_2,text_3,text_4
				text_1="|"&yourip&"|"&ip_time&"|"
				num_1=len(cache_ip)
				num_2=len(text_1)
				num_3=instr(cache_ip,text_1)
				num_4=num_1-num_2-num_3+1
				text_2=left(cache_ip,num_3)
				text_3=right(cache_ip,num_4)
				text_4=yourip&"|"&time_now&"|"
				temp_s=text_2&text_4&text_3
			end if
			Application.Lock
			Application("cache_ip")=temp_s
			Application.UnLock
		end if
		Sql="select ID,HU_in,HU_time from 74hu_link Where ID="&ID
		Rs.open Sql,conn,1,3
		Rs("HU_in")=Rs("HU_in")+1
		Rs("HU_time")=time_now
		Rs.update()
		rs.close
		set rs=nothing
		r ""&http_path&"?aid=index"
	elseif act="view" then
		Sql="select * from 74hu_link Where id="&id
		Rs.open Sql,conn,1,3
		If Not rs.eof Then
			Rs("HU_out")=Rs("HU_out")+1
			Rs("OUTtime")=time_now
			Rs.update()
		Else
			r ""&http_path&"?aid=index"
		End If
		If links=0 Then
			w "<meta http-equiv=""refresh"" content=""1;url="&noubburl(rs("url"))&"""><title>"&nowml(rs("name"))&"</title></head><body><div class=""main"">"&_
				"<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-<a href="""&http_path&"link.asp?"&a_sid&""">友链</a>-查看网站</div>"&_
				"站名："&nowml(rs("name"))&"<br/>"&_
				"介绍："&nowml(rs("jian"))&"<br/>"&_
				"- > <a href="""&noubburl(rs("url"))&""">访问网站</a><br/>回链：http://"&wapurl&"/link.asp?act=go&amp;id="&rs("id")&"<br/><br/>"
		Else
			r nourl(rs("url"))
		End If
		rs.close
		set rs=nothing
	elseif act="post" then
		Dim classid,name,namt,url,jian
		classid=Request.QueryString("classid")
		name=getD("name","")
		namt=getD("namt","")
		url=LCase(getD("url",""))
		jian=getD("jian","")
		if session("name")=1 then
			wn "<title>重复申请</title></head><body><div class=""main"">你刚才已申请过了！请不要重复申请！,<a href="""&http_path&"link.asp?act=post&amp;"&a_sid&""">返回</a></div></body></html>"
		else
			if name="" or namt="" or url="" or jian="" or classid="" or isnumeric(classid)=false then
				wn "<title>出错了吧</title></head><body><div class=""main"">各项都要填写,不能为空！,<a href="""&http_path&"link.asp?act=post&amp;"&a_sid&""">返回</a></div></body></html>"
			else
				RS.open "select * from 74hu_link",conn,1,3
				RS.addnew
				RS("name")=name
				RS("namt")=namt
				RS("url")=url
				RS("classid")=classid
				RS("jian")=jian
				RS("active")=active
				RS.update
				session.timeout=1
				session("name")=1
			end if
		end if
		w "<title>申请友链成功</title></head><body><div class=""main"">申请友链成功,<a href="""&http_path&"link.asp?act=you&amp;"&a_sid&""">查看回链</a><br/>"
		rs.close
		set rs=nothing
	elseif act="list" then
		add=request.QueryString("class")
		if add="" or IsNumeric(add)=false then
			r ""&http_path&"?aid=index"
		else
			Set rss=Server.CreateObject("ADODB.Recordset")
			rss.open "Select class from 74hu_linkc where classid="&add,conn,1,1
			if not rss.eof then
				Dim classname
				classname=rss("class")
			end if
			rss.close
			set rss=nothing
			w "<title>"&classname&"网站</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"link.asp?"&a_sid&""">友链</a>-"&classname&"网站</div>"
			sql="Select classid,id,name from 74hu_link where classid="&add&" And Active=0 and del=0  order by HU_time desc"
			rs.open sql,conn,1,1
			If Not rs.eof Then
				PageSize=15
				Count=rs.recordcount
				page=getN("page",1)
				if page<=0 then page=1
				pagecount=(count+pagesize-1)\pagesize
				if page>pagecount then page=pagecount
				rs.move(pagesize*(page-1))
				For i=1 To PageSize
					If rs.eof Then Exit For
					If i Mod 2 = 0 Then
						class_="even"
					Else
						class_="odd"
					End If
					w "<div class="""&class_&""">"&i+(page-1)*PageSize&".<a href="""&http_path&"link.asp?act=view&amp;class="&rs("classid")&"&amp;id="&rs("id")&"&amp;"&a_sid&""">"&nowml(rs("name"))&"</a></div>"
					rs.moveNext
				Next
				w showsPage("link.asp", "act:list,class:"&add, page, pagecount)&"<br/>"
			Else
				w "暂时没有添加！<br/>"
			end if
			w "<a href="""&http_path&"link.asp?"&a_sid&""">返回友链首页</a><br/>"
			rs.close
			set rs=nothing
		end if
	elseif act="you" then
		w "<title>申请友链成功</title></head><body><div class=""main"">"
		Sql="select top 1 id from 74hu_link order by id desc"
		RS.open Sql,conn,1,1
		w "添加友链地址成功，"
		if Active=1 then
			w "请等待站长审核，审核通过后才会显示<br/>"
		else
			w "你的友链已经显示出来!<br/>"
		End if
		w "贵站返回我站的链接地址是:http://"&wapurl&"/link.asp?act=go&amp;id="&Rs("id")&"<br/>网站名称:"&waptitle&"<br/>"&_
			"<a href='"&http_path&"link.asp?"&a_sid&"'>返回友链首页</a><br/>"
		rs.close
		set rs=nothing
	elseif act="add" then
		w "<title>申请友链</title></head><body><div class=""main""><form name=""link"" action="""&http_path&""" method=""get"">"&_
			"网站名称:(3-6字)<br/><input type=""text"" name=""name"" maxlength=""7"" value=""""/><br/>"&_
			"网站简称:("&linknum&"字)<br/><input type=""text"" name=""namt"" maxlength="""&linknum&""" value=""""/><br/>"&_
			"网址:(需http://)<br/><input type=""text"" name=""url"" value=""http://""/><br/>"&_
			"网站分类：<select name=""classid"">"
		Sql = "select classid,class from 74hu_linkc"
		Rs.open Sql,conn,1,1
		do while not Rs.eof
			w "<option value="""&rs("classid")&""">"&rs("class")&"</option>"
			rs.movenext
		Loop
		w "</select><br/>"&_
			"网站简介：(50字内)<br/><input type=""text"" name=""jian"" value=""暂时没有介绍…"" maxlength=""100""/><br/>"&_
			"<input type=""hidden"" name=""aid"" value=""link""/><input type=""hidden"" name=""act"" value=""post""/>"&_
			"<input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/><input type=""submit"" value=""确定提交""/></form>"&_
			"<br/>"&_
			"<br/>欢迎优秀WAP网站交换链接。"&_
			"<br/>1.合作原则:流量互补,双赢发展,"&linkactive&"天没流量首页自动隐藏。"&_
			"<br/>2.流程: "&_
			"<br/>1)提交网站，获取链接地址; "&_
			"<br/>2)将我站的链接放到贵站明显位置。"&_
			"<br/>3)我站人员3个工作日内审核网站，合适网站即可收录。"&_
			"<br/>"&_
			"<br/>申请友情链接前请先在您的网站上做好本站的链接："&_
			"<br/>网站名称："&waptitle&_
			"<br/>做好我站链接后，我们会及时进行审核。<br/>"&_
			"<a href='"&http_path&"link.asp?"&a_sid&"'>返回友链首页</a><br/>"
		rs.close
		set rs=nothing
	elseif act="wait" then'待审
		w "<title>待审友链</title></head><body><div class=""main""><div class=""nav"">-<a href='"&http_path&"?"&a_sid&"'>首页</a>-"&_
			"<a href='"&http_path&"link.asp?"&a_sid&"'>友链</a>-待审友链</div>"
		sql="Select classid,id,name from 74hu_link where Active=1 and del=0 order by HU_time desc"
		rs.open sql,conn,1,1
		If Not rs.eof Then
			PageSize=15
			Count=rs.recordcount
			page=getN("page",1)
			if page<=0 then page=1
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			rs.move(pagesize*(page-1))
			For i=1 To PageSize
				If rs.eof Then Exit For
				w ""&i+(page-1)*PageSize&"."&nowml(rs("name"))&"<br/>"
				rs.moveNext
			Next
			w showsPage("link.asp", "act:wait", page, pagecount)
		Else
			w "暂时没有待审网站！<br/>"
		end if
		w "<a href='"&http_path&"link.asp?"&a_sid&"'>返回友链首页</a>"
		rs.close
		set rs=nothing
	elseIf act="query" then'查回链
		a=getDD("a","")
		lnk=getD("link","")
		w "<title>查找回链</title></head><body><div class=""main""><div class=""nav"">-<a href='"&http_path&"?"&a_sid&"'>首页</a>-"&_
			"<a href='"&http_path&"link.asp?"&a_sid&"'>友链</a>-查找回链</div>"
		If a="" Then
			w "<form name=""link"" action="""&http_path&"link.asp?"&a_sid&"&amp;act=query&amp;a=1"" method=""post"">网址:<input name=""link""/><br/>"&_
				"<input type=""submit"" value=""查找回链""/></form>"
		Else
			If lnk="" Then
				w "网站不能为空"
			Else
				Set rs=Server.CreateObject("ADODB.Recordset")
				rs.open "select top 1 id,url,name,active from 74hu_link where url like '%" & lnk & "%'",conn,1,1
				If Not rs.eof Then
					w "网址:"&nowml(rs("url"))&"<br/>站名:"&nowml(rs("name"))&"<br/>回链:http://"&wapurl&"/link.asp?act=go&amp;id="&Rs("id")&"<br/>状态:"
					If rs("active")=1 Then
						w "未审核"
					Else
						w "已审核"
					End If
				Else
					w "没有这个网站!"
				End If
				rs.close
				Set rs=Nothing
			End If
		End If
		w "<br/><a href='"&http_path&"link.asp?"&a_sid&"'>返回友链首页</a>"
	else
		w "<a href='"&http_path&"link.asp?"&a_sid&"'>返回友链首页</a>"
	end if
End Sub
' Wap1.0搜索页
Sub showSearch
	dim keyword,id
	id=getN("id",1)
	keyword=getFilter("keyword","")
	w "<card title=""网站搜索""><p align="""&wapconst&""">"
	checkMsg()'信息
	if keyword="" then
		w "网站搜索引擎：<br/>"&_
		 "<input type=""text"" name=""keyword"&Time_r&""" value=""美女"" title=""请输入关键词""/><br/>"&_
		 "搜<anchor>文章<go href="""&http_path&"search.asp?"&a_sid&""" method=""post"">"&_
		 "<postfield name=""keyword"" value=""$(keyword"&Time_r&")""/><postfield name=""sear"" value=""0""/></go></anchor>"&_
		 ".<anchor>标题<go href="""&http_path&"search.asp?"&a_sid&""" method=""post"">"&_
		 "<postfield name=""keyword"" value=""$(keyword"&Time_r&")""/><postfield name=""sear"" value=""1""/></go></anchor>"&_
		 ".<anchor>内容<go href="""&http_path&"search.asp?"&a_sid&""" method=""post"">"&_
		 "<postfield name=""keyword"" value=""$(keyword"&Time_r&")""/><postfield name=""sear"" value=""2""/></go></anchor><br/>"&_
		 "搜<anchor>帖子<go href="""&http_path&"search.asp?"&a_sid&"&amp;a=1"" method=""post"">"&_
		 "<postfield name=""keyword"" value=""$(keyword"&Time_r&")""/><postfield name=""sear"" value=""0""/></go></anchor>"&_
		 ".<anchor>标题<go href="""&http_path&"search.asp?"&a_sid&"&amp;a=1"" method=""post"">"&_
		 "<postfield name=""keyword"" value=""$(keyword"&Time_r&")""/><postfield name=""sear"" value=""1""/></go></anchor>"&_
		 ".<anchor>内容<go href="""&http_path&"search.asp?"&a_sid&"&amp;a=1"" method=""post"">"&_
		 "<postfield name=""keyword"" value=""$(keyword"&Time_r&")""/><postfield name=""sear"" value=""2""/></go></anchor><br/>"&_
		 "搜<anchor>网页<go href=""http://u.yicha.cn/union/x.jsp"" method=""post""><postfield name=""keyword"" value=""$(keyword"&Time_r&")""/>"&_
		 "<postfield name=""site"" value=""2145930044""/><postfield name=""p"" value=""p""/></go></anchor>"&_
		 ".<anchor>图片<go href=""http://u.yicha.cn/union/x.jsp"" method=""post""><postfield name=""keyword"" value=""$(keyword"&Time_r&")""/>"&_
		 "<postfield name=""site"" value=""2145930044""/><postfield name=""p"" value=""i""/></go></anchor>"&_
		 ".<anchor>MP3<go href=""http://u.yicha.cn/union/x.jsp"" method=""post""><postfield name=""keyword"" value=""$(keyword"&Time_r&")""/>"&_
		 "<postfield name=""site"" value=""2145930044""/><postfield name=""p"" value=""mp3""/></go></anchor><br/>"
	else
		dim rs,sear,a,PageSize,Count,page,pagecount,i
		a=getN("a",0)
		sear=getN("sear",0)
		set rs=Server.CreateObject("ADODB.Recordset")
		If a=0 Then
			if sear=1 then
				rs.open"select id,title from 74hu_article where classid<>0 and title like '%" & keyword & "%' order by id desc",conn,1,1
			elseif sear=2 then
				rs.open"select id,title from 74hu_article where classid<>0 and InStr(1,test,'"&Keyword&"',0)>0 order by id desc",conn,1,1
			else
				rs.open"select id,title from 74hu_article where classid<>0 and InStr(1,test,'"&Keyword&"',0)>0 or title like '%" & keyword & "%' order by id desc",conn,1,1
			end if
			If Not rs.eof Then
				PageSize=10
				Count=rs.recordcount
				page=getN("page",0)
				if page<=0 then page=1
				pagecount=(count+pagesize-1)\pagesize
				if page>pagecount then page=pagecount
				rs.move(pagesize*(page-1))
				w "共:"&count&"篇相关文章<br/>"
				For i=1 To PageSize
					If rs.eof Then Exit For
					w "<a href="""&http_path&"article.asp?id="&rs("id")&"&amp;"&a_sid&""">"&i+(page-1)*PageSize&"."&nowml(rs("title"))&"</a><br/>"
					rs.moveNext
				Next
				w showPage("search.asp", "keyword:"&keyword&",sear:"&sear, page, pagecount)
			Else
				w "没有符合条件的文章<br/>"
			End If
		Else
			if sear=1 then
				rs.open"select id,title from 74hu_topic where title like '%" & keyword & "%' order by id desc",conn,1,1
			elseif sear=2 then
				rs.open"select id,title from 74hu_topic where InStr(1,content,'"&Keyword&"',0)>0 order by id desc",conn,1,1
			else
				rs.open"select id,title from 74hu_topic where InStr(1,content,'"&Keyword&"',0)>0 or title like '%" & keyword & "%' order by id desc",conn,1,1
			end if
			If Not rs.eof Then
				PageSize=10
				Count=rs.recordcount
				page=getN("page",0)
				if page<=0 then page=1
				pagecount=(count+pagesize-1)\pagesize
				if page>pagecount then page=pagecount
				rs.move(pagesize*(page-1))
				w "共:"&count&"篇相关帖子<br/>"
				For i=1 To PageSize
					If rs.eof Then Exit For
					w "<a href="""&http_path&"bbs_posts.asp?id="&rs("id")&"&amp;"&a_sid&""">"&i+(page-1)*PageSize&"."&nowml(rs("title"))&"</a><br/>"
					rs.moveNext
				Next
				w showPage("search.asp", "keyword:"&keyword&",a:1,sear:"&sear, page, pagecount)
			Else
				w "没有符合条件的帖子<br/>"
			End If
		End If
		rs.close
		set rs=nothing
		w "<a href="""&http_path&"search.asp?"&a_sid&""">返回搜索中心</a><br/>"
	end if
End Sub
' Wap2.0搜索页
Sub showsSearch
	dim keyword,id
	id=getN("id",1)
	keyword=getFilter("keyword","")
	w "<title>网站搜索</title></head><body><div class=""main"">"
	checkMsg()'信息
	if keyword="" then
		w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-网站搜索</div>"&_
		"※文章搜索：<br/>"&_
		 "<form name=""txtsearch"" action="""&http_path&"search.asp"" method=""post"">"&_
		 "<input type=""text"" name=""keyword"" value=""""/><br/>"&_
		 "<select name=""sear""><option value=""1"">标题</option><option value=""2"">内容</option><option value=""0"">全文</option></select>"&_
		 "<input type=""hidden"" name="""&bbssid&""" value="""&sid&""" />"&_
		 "&nbsp;<input type=""submit"" name=""submit"" value=""开始搜索"" /></form><br/>"&_
		 "<br/>※论坛搜索：<br/>"&_
		 "<form name=""bbssearch"" action="""&http_path&"search.asp"" method=""post"">"&_
		 "<input type=""text"" name=""keyword"" value=""""/><br/>"&_
		 "<select name=""sear""><option value=""1"">标题</option><option value=""2"">内容</option><option value=""0"">全文</option></select>"&_
		 "<input type=""hidden"" name=""a"" value=""1"" />"&_
		 "<input type=""hidden"" name="""&bbssid&""" value="""&sid&""" />"&_
		 "&nbsp;<input  type=""submit"" name=""submit"" value=""开始搜索"" /></form><br/>"&_
		 "<br/>※全网搜索：<br/>"&_
		 "<form name=""wapsearch"" action=""http://u.yicha.cn/union/x.jsp"" method=""post"">"&_
		 "<input type=""text"" name=""keyword"" value=""""/>"&_
		 "<input name=""site"" value=""2145930044"" type=""hidden""/><br/>"&_
		 "<select name=""p""><option value=""p"">网页</option><option value=""i"">图片</option><option value=""mp3"">MP3</option></select>"&_
		 "&nbsp;<input type=""submit"" name=""submit"" value=""开始搜索"" /></form><br/>"
	else
		dim rs,sear,a,PageSize,Count,page,pagecount,i,class_
		a=getN("a",0)
		sear=getN("sear",0)
		w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-<a href="""&http_path&"search.asp?"&a_sid&""">搜索</a>-搜索结果</div>"
		set rs=Server.CreateObject("ADODB.Recordset")
		If a=0 Then
			if sear=1 then
				rs.open"select id,title from 74hu_article where classid<>0 and title like '%" & keyword & "%' order by id desc",conn,1,1
			elseif sear=2 then
				rs.open"select id,title from 74hu_article where classid<>0 and InStr(1,test,'"&Keyword&"',0)>0 order by id desc",conn,1,1
			else
				rs.open"select id,title from 74hu_article where classid<>0 and InStr(1,test,'"&Keyword&"',0)>0 or title like '%" & keyword & "%' order by id desc",conn,1,1
			end if
			If Not rs.eof Then
				PageSize=10
				Count=rs.recordcount
				page=getN("page",0)
				if page<=0 then page=1
				pagecount=(count+pagesize-1)\pagesize
				if page>pagecount then page=pagecount
				rs.move(pagesize*(page-1))
				w "共:"&count&"篇相关文章<br/>"
				For i=1 To PageSize
					If rs.eof Then Exit For
					If i mod 2 = 0 Then
						class_="even"
					Else
						class_="odd"
					End If
					w "<div class="""&class_&"""><a href="""&http_path&"article.asp?id="&rs("id")&"&amp;"&a_sid&""">"&i+(page-1)*PageSize&"."&nowml(rs("title"))&"</a></div>"
					rs.moveNext
				Next
				w showsPage("search.asp", "keyword:"&keyword&",sear:"&sear, page, pagecount)&"<br/>"
			Else
				w "没有符合条件的文章<br/>"
			end if
		Else
			if sear=1 then
				rs.open"select id,title from 74hu_topic where title like '%" & keyword & "%' order by id desc",conn,1,1
			elseif sear=2 then
				rs.open"select id,title from 74hu_topic where InStr(1,content,'"&Keyword&"',0)>0 order by id desc",conn,1,1
			else
				rs.open"select id,title from 74hu_topic where InStr(1,content,'"&Keyword&"',0)>0 or title like '%" & keyword & "%' order by id desc",conn,1,1
			end if
			If Not rs.eof Then
				PageSize=10
				Count=rs.recordcount
				page=getN("page",0)
				if page<=0 then page=1
				pagecount=(count+pagesize-1)\pagesize
				if page>pagecount then page=pagecount
				rs.move(pagesize*(page-1))
				w "共:"&count&"篇相关帖子<br/>"
				For i=1 To PageSize
					If rs.eof Then Exit For
					If i mod 2 = 0 Then
						class_="even"
					Else
						class_="odd"
					End If
					w "<div class="""&class_&"""><a href="""&http_path&"bbs_posts.asp?id="&rs("id")&"&amp;"&a_sid&""">"&i+(page-1)*PageSize&"."&nowml(rs("title"))&"</a></div>"
					rs.moveNext
				Next
				w showsPage("search.asp", "keyword:"&keyword&",a:1,sear:"&sear, page, pagecount)&"<br/>"
			Else
				w "没有符合条件的帖子<br/>"
			end if
		End If
		rs.close
		set rs=nothing
		w "<a href="""&http_path&"search.asp?"&a_sid&""">返回搜索中心</a><br/>"
	end if
End Sub
' wap1.0注册页面
Sub showReg
	Dim a,r,url
	a=getData("a")
	url=getData("_u")'返回地址
	w "<card title=""会员注册""><p align="""&wapconst&""">"
	If a="" or bbsreg=0 Then
		Dim ss
		ss=getCheckCode
		w "会员注册-<a href="""&http_path&"bbs_login.asp?_u="&url&""">登录</a><br/>"
		If bbsagree<>"" Then w ubbcode(bbsagree) &"<br/>"
		If bbsreg=0 Then w "网站暂停注册新会员<br/>"
		w "用户名：<br/><input type=""text"" name=""name"" value="""" maxlength=""16""/><br/>"&_
			"密码：<br/><input type=""text"" name=""pass"" value="""" maxlength=""16""/><br/>验证码："&ss&"<br/><input type=""text"" name=""num1"" value=""""/>"&_
			"<br/><anchor>提交<go href="""&http_path&"bbs_reg.asp?"&a_sid&"&amp;a=1"" method=""post""><postfield name=""name"" value=""$(name)""/>"&_
			"<postfield name=""pass"" value=""$(pass)""/><postfield name=""num1"" value=""$(num1)""/><postfield name=""_u"" value="""&url&"""/>"&_
			"<postfield name=""num2"" value="""&numEncode(ss)&"""/></go></anchor> <a href="""&http_path&"bbs_login.asp?_u="&url&""">会员登录</a><br/>"&_
			"温馨提示：<br/>1.用户名不能以数字开头<br/>2.用户名不要含有敏感词<br/>3.用户名密码长度3~16位"
	Else
		If Request.Form("num1")<>numDecode(request.form("num2")) Then wn "验证码错误！</p></card></wml>"
		Dim name,pass
		name=getD("name","")
		pass=getD("pass","")
		If name="" or pass="" Then wn "用户名和密码不能为空！</p></card></wml>"
		If IsNumeric(left(name,1)) Then wn "用户名不能以数字开头！</p></card></wml>"
		If len(name)>16 Or len(pass)>16 Then wn "用户名和密码最长16位！</p></card></wml>"
		If len(name)<3 Or len(pass)<3 Then wn "用户名和密码最短3位！</p></card></wml>"
		Dim count
		count = conn.execute("select count(id) from 74hu_user where name='"&name&"'")(0)
		If count<>"0" Then wn "用户名"""&name&"""已存在！请选择其他用户名</p></card></wml>"
		sid=getOnlySid()'登录时生成正确的唯一sid
		conn.Execute("insert into 74hu_user ([name],[password],[regtime],[sid],[regip],[hu_level],[money],[sex],[topic],[reply]) values ('"&name&"','"&pass&"','"&time_now&"','"&sid&"','"&User_ip&"',0,0,0,0,0)")
		w "注册成功，请牢记您的注册信息<br/>用户名："&name&"<br/>密码："&pass
		w "<br/><a href="""&http_path&"bbs_login.asp?_u="&url&""">验证登录</a><br/>"
	End If
End Sub
' wap2.0注册页面
Sub showsReg
	Dim a,r,url
	a=getData("a")
	url=getData("_u")'返回地址
	w "<title>会员注册</title></head><body><div class=""main"">"
	If a="" or bbsreg=0 Then
		Dim ss
		ss=getCheckCode
		w "<div class=""nav"">会员注册-<a href="""&http_path&"bbs_login.asp?_u="&url&""">登录</a></div>"
		If bbsagree<>"" Then w ubbcode(bbsagree) &"<br/>"
		If bbsreg=0 Then w "<div class=""tip"">网站暂停注册新会员</div>"
		w "<form name=""reg"" method=""post"" action="""&http_path&"bbs_reg.asp"">用户名：<br/><input type=""text"" name=""name"" value="""" maxlength=""16""/><br/>"&_
			"密码：<br/><input type=""text"" name=""pass"" value="""" maxlength=""16""/><br/>验证码："&ss&"<br/><input type=""text"" name=""num1"" value=""""/>"&_
			"<input type=""hidden"" name=""a"" value=""1""/><input type=""hidden"" name=""num2"" value="""&numEncode(ss)&"""/><input type=""hidden"" name=""_u"" value="""&url&"""/>"&_
			"<br/><input type=""submit"" value=""提交""/></form> <a href="""&http_path&"bbs_login.asp?_u="&url&""">会员登录</a><br/>"&_
			"<p align="""&wapconst&""">温馨提示：<br/>1.用户名不能以数字开头<br/>2.用户名不要含有敏感词<br/>3.用户名密码长度3~16位</p>"
	Else
		If Request.Form("num1")<>numDecode(request.form("num2")) Then wn "验证码错误！</div></body></html>"
		Dim name,pass
		name=getD("name","")
		pass=getD("pass","")
		If name="" or pass="" Then wn "用户名和密码不能为空！</div></body></html>"
		If IsNumeric(left(name,1)) Then wn "用户名不能以数字开头！</div></body></html>"
		If len(name)>16 Or len(pass)>16 Then wn "用户名和密码最长16位！</div></body></html>"
		If len(name)<3 Or len(pass)<3 Then wn "用户名和密码最短3位！</div></body></html>"
		Dim count
		count = conn.execute("select count(id) from 74hu_user where name='"&name&"'")(0)
		If count<>"0" Then wn "用户名"""&name&"""已存在！请选择其他用户名</div></body></html>"
		sid=getOnlySid()'登录时生成正确的唯一sid
		conn.Execute("insert into 74hu_user ([name],[password],[regtime],[sid],[regip],[hu_level],[money],[sex],[topic],[reply]) values ('"&name&"','"&pass&"','"&time_now&"','"&sid&"','"&User_ip&"',0,0,0,0,0)")
		w "注册成功，请牢记您的注册信息<br/>用户名："&name&"<br/>密码："&pass
		w "<br/><a href="""&http_path&"bbs_login.asp?_u="&url&""">验证登录</a><br/>"
	End If
End Sub
' wap1.0登录页面
Sub showLogin
	Dim a,url
	a=getData("a")
	url=getData("_u")'返回地址
	w "<card title=""会员登录""><p align="""&wapconst&""">"
	If a="" Then
		Dim ss
		ss=getCheckCode
		w "会员登录-<a href="""&http_path&"bbs_reg.asp?_u="&url&""">注册</a><br/>"&_
			"用户名或ID号：<br/><input type=""text"" name=""name"&time_r&""" value=""""/><br/>"&_
			"密码：<br/><input type=""password"" name=""pass"&time_r&""" value=""""/><br/>"&_
			"安全性：<select name=""safe"&time_r&"""><option value=""0"">正常</option><option value=""1"">高级</option></select><br/>"&_
			"验证码："&ss&"<br/><input type=""text"" name=""num1"&time_r&""" value=""""/>"&_
			"<br/><anchor>登录<go href=""bbs_login.asp?"&a_sid&"&amp;a=1"" method=""post""><postfield name=""name"" value=""$(name"&time_r&")""/>"&_
			"<postfield name=""pass"" value=""$(pass"&time_r&")""/><postfield name=""num1"" value=""$(num1"&time_r&")""/>"&_
			"<postfield name=""safe"" value=""$(safe"&time_r&")""/><postfield name=""num2"" value="""&numEncode(ss)&"""/>"&_
			"<postfield name=""_u"" value="""&url&"""/></go></anchor> <a href="""&http_path&"bbs_reg.asp?_u="&url&""">会员注册</a><br/>"&_
			"<br/>温馨提示：安全性选高级，登录后会使原来的书签失效<br/>"
	Else
		If Request.Form("num1")<>numDecode(request.form("num2")) Then wn "验证码错误！</p></card></wml>"
		Dim name,pass
		name=getD("name","")
		pass=getD("pass","")
		safe=getN("safe",0)
		If name="" or pass="" Then wn "用户名和密码不能为空！</p></card></wml>"
		Dim rs,sql
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select top 1 sid,logip,logtime from 74hu_user where name='"&name&"' and password='"&pass&"'"
		If IsNumeric(name) Then sql = "select top 1 sid,logip,logtime from 74hu_user where id="&name&" and password='"&pass&"'"
		rs.open sql,conn,1,3
		If Not rs.eof Then
			If safe=1 Then
				sid=getOnlySid()
				rs("sid")=sid
			Else
				sid=rs("sid")
				If Trim(sid)="" Then'后台添加用户sid为空
					sid=getOnlySid()
					rs("sid")=sid
				End If
			End If
			a_sid=bbssid&"="&sid
			rs("logip")=User_ip
			rs("logtime")=time_now
			rs.update
			w "登录成功！<br/><a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a> <a href="""&getBackUrl(url)&"&amp;"&a_sid&""">返回来页</a><br/>"
		Else
			w "用户名或密码错误！"
		End If
		rs.close
		Set rs=Nothing
	End If
End Sub
' wap2.0登录页面
Sub showsLogin
	Dim a,url
	a=getData("a")
	url=getData("_u")'返回地址
	w "<title>会员登录</title></head><body><div class=""main"">"
	If a="" Then
		Dim ss
		ss=getCheckCode
		w "<div class=""nav"">会员登录-<a href="""&http_path&"bbs_reg.asp?_u="&url&""">注册</a></div>"&_
			"<form name=""log"" action=""bbs_login.asp"" method=""post"">用户名或ID号：<br/><input type=""text"" name=""name"" value=""""/><br/>"&_
			"密码：<br/><input type=""password"" name=""pass"" value=""""/><br/>"&_
			"安全性：<select name=""safe""><option value=""0"">正常</option><option value=""1"">高级</option></select><br/>"&_
			"验证码："&ss&"<br/><input type=""text"" name=""num1"" value=""""/>"&_
			"<input type=""hidden"" name=""a"" value=""1""/><input type=""hidden"" name=""num2"" value="""&numEncode(ss)&"""/><input type=""hidden"" name=""_u"" value="""&url&"""/>"&_
			"<br/><input type=""submit"" value=""提交""/></form> <a href="""&http_path&"bbs_reg.asp?_u="&url&""">会员注册</a><br/>"&_
			"<br/>温馨提示：安全性选高级，登录后会使原来的书签失效<br/>"
	Else
		If Request.Form("num1")<>numDecode(request.form("num2")) Then wn "验证码错误！</div></body></html>"
		Dim name,pass
		name=getD("name","")
		pass=getD("pass","")
		safe=getN("safe",0)
		If name="" or pass="" Then wn "用户名和密码不能为空！</div></body></html>"
		Dim rs,sql
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select top 1 sid,logip,logtime from 74hu_user where name='"&name&"' and password='"&pass&"'"
		If IsNumeric(name) Then sql = "select top 1 sid,logip,logtime from 74hu_user where id="&name&" and password='"&pass&"'"
		rs.open sql,conn,1,3
		If Not rs.eof Then
			If safe=1 Then
				sid=getOnlySid()
				rs("sid")=sid
			Else
				sid=rs("sid")
				If Trim(sid)="" Then'后台添加用户sid为空
					sid=getOnlySid()
					rs("sid")=sid
				End If
			End If
			a_sid=bbssid&"="&sid
			rs("logip")=User_ip
			rs("logtime")=time_now
			rs.update
			w "登录成功！<br/><a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a> <a href="""&getBackUrl(url)&"&amp;"&a_sid&""">返回来页</a><br/>"
		Else
			w "用户名或密码错误！"
		End If
		rs.close
		Set rs=Nothing
	End If
End Sub
' wap1.0论坛页面
Sub showTopic
	Dim id,act,tpl
	id=getN("id",1)
	act=LCase(getData("act"))
	tpl=ubbcode(tpltopic)
	Dim rs,sql
	Set rs=Server.CreateObject("ADODB.Recordset")
	sql = "select class,wmltxt,relid from 74hu_class where lx=3 and classid="&id
	rs.open sql,conn,1,1
	If Not rs.eof Then
		Dim ex_
		If act="new" Then
			ex_ = "新帖.<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&""">顶帖</a>."
		Else
			ex_ = "<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"&amp;act=new"">新帖</a>.顶帖."
		End If
		Select Case act
			Case ""
				ex_ = "<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"&amp;act=new"">新帖</a>.顶帖.<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"&amp;act=good"">精华</a>"
				sql = "select t.id,t.title,t.reply,t.hit,t.pid,t.type,u.name from 74hu_topic t left join 74hu_user u on t.userid=u.id where t.classid="&id&" order by t.pid desc,t.livetime desc"
			Case "new"
				ex_ = "新帖.<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&""">顶帖</a>.<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"&amp;act=good"">精华</a>"
				sql = "select t.id,t.title,t.reply,t.hit,t.type,u.name from 74hu_topic t left join 74hu_user u on t.userid=u.id where t.classid="&id&" order by t.id desc"
			Case "good"
				ex_ = "<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"&amp;act=new"">新帖</a>.<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&""">顶帖</a>.精华"
				sql = "select t.id,t.title,t.reply,t.hit,u.name from 74hu_topic t left join 74hu_user u on t.userid=u.id where t.classid="&id&" and t.type=1 order by t.id desc"
		End Select
		Dim classname,remark,staff,userid
		classname=nowml(rs("class"))
		remark=nowml(rs("wmltxt"))
		staff=rs("relid")
		rs.close
		userid=userArr(0)
		w "<card title="""&classname&"""><p align="""&wapconst&"""><a id=""top"" name=""top""></a>"
		checkMsg()'信息
		w "-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-"&classname&"<br/>"
		' if remark<>"" then w remark&"<br/>"
		' w ""&showImg("post")&"<a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&""">发帖</a>."& ex_ &"<br/>"
		Dim theme,ad4txt,post,list
		theme=remark
		post=showImg("post")&"<a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&""">发帖</a>."& ex_
		ad4txt=getAD(4,1)
		rs.open sql,conn,1,1
		If Not rs.eof Then
			Dim tid,title,reply,name,hit,pid,type_
			Dim pagesize,count,page,pagecount,i
			Dim tip_'控制置顶和精铁标志
			PageSize=numbbslist
			Count=rs.recordcount
			page=getN("page",1)
			if page<=0 then page=1
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			rs.move(pagesize*(page-1))
			For i=1 To PageSize
				If rs.eof Then Exit For
				tip_=""
				tid=rs("id")
				title=rs("title")
				reply=rs("reply")
				name=rs("name")
				hit=rs("hit")
				Select Case act
					Case "new"
						type_=rs("type")
						If type_=1 Then tip_= showImg("jing")
					Case "good"
						tip_= showImg("jing")
					Case ""
						pid=rs("pid")
						If pid=1 Then tip_=showImg("ding")
						type_=rs("type")
						If type_=1 Then tip_= tip_&showImg("jing")
				End Select
				list=list& "<a href='"&http_path&"bbs_posts.asp?id="&tid&"&amp;"&a_sid&"&amp;p="&page&"&amp;act="&act&"'>"&tip_&(i+(page-1)*PageSize)&"."&nowml(rs("title"))&"</a><br/>"&_
					""&name&"(<a href='"&http_path&"bbs_replys.asp?id="&tid&"&amp;"&a_sid&"'>"&reply&"</a>/"&hit&")<br/>"

				rs.moveNext
			Next
			list=list& showsPage("bbs_topic.asp", "aid:list,act:"&act&",id:"&id, page, pagecount)
		Else
			list= "暂时没有帖子"
		End If
		admin= "<br/>"&showImg("light")&"<a href="""&http_path&"bbs_board.asp?id="&id&"&amp;"&a_sid&""">版务</a>"
		If staff<>0 Then admin=admin& " 版主:<a href="""&http_path&"bbs_user.asp?id="&staff&"&amp;"&a_sid&""">"&getUserName(staff)&"</a>"
		
		Dim rndnum
		rndnum=time_r'要避免内容中有{}标签,需将{}转义
		tpl=Replace(tpl,"{","{_74hu_"&rndnum)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"ad4}",ad4txt,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"post}",post,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"admin}",admin,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"list}",list,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"theme}",theme,1,1)
		w tpl
	Else
		w "<card title=""论坛页面出错！""><p align="""&wapconst&""">没有这个论坛!"
	End If
	rs.close
	Set rs=Nothing
End Sub
' wap2.0论坛页面
Sub showsTopic
	Dim id,act,tpl
	id=getN("id",1)
	act=LCase(getData("act"))
	tpl=ubbcode(tpltopic)
	Dim rs,sql
	Set rs=Server.CreateObject("ADODB.Recordset")
	sql = "select class,wmltxt,relid from 74hu_class where lx=3 and classid="&id
	rs.open sql,conn,1,1
	If Not rs.eof Then
		Dim ex_
		If act="new" Then
			ex_ = "新帖.<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&""">顶帖</a>."
		Else
			ex_ = "<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"&amp;act=new"">新帖</a>.顶帖."
		End If
		Select Case act
			Case ""
				ex_ = "<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"&amp;act=new"">新帖</a>.顶帖.<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"&amp;act=good"">精华</a>"
				sql = "select t.id,t.title,t.reply,t.hit,t.pid,t.type,u.name from 74hu_topic t left join 74hu_user u on t.userid=u.id where t.classid="&id&" order by t.pid desc,t.livetime desc"
			Case "new"
				ex_ = "新帖.<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&""">顶帖</a>.<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"&amp;act=good"">精华</a>"
				sql = "select t.id,t.title,t.reply,t.hit,t.type,u.name from 74hu_topic t left join 74hu_user u on t.userid=u.id where t.classid="&id&" order by t.id desc"
			Case "good"
				ex_ = "<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"&amp;act=new"">新帖</a>.<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&""">顶帖</a>.精华"
				sql = "select t.id,t.title,t.reply,t.hit,u.name from 74hu_topic t left join 74hu_user u on t.userid=u.id where t.classid="&id&" and t.type=1 order by t.id desc"
		End Select
		Dim classname,remark,userid
		classname=nowml(rs("class"))
		remark=nowml(rs("wmltxt"))
		staff=rs("relid")
		rs.close
		userid=userArr(0)
		w "<title>"&classname&"</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
		checkMsg()'信息
		w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-"&classname&"</div>"
		' if remark<>"" then w remark&"<br/>"
		' w "<div class=""even"">"&showImg("post")&"<a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&""">发帖</a>."& ex_ &"</div>"
		Dim theme,ad4txt,post,list
		theme=remark
		post=showImg("post")&"<a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&""">发帖</a>."& ex_
		ad4txt=getAD(4,1)
		' w getAD(4,1)
		rs.open sql,conn,1,1
		If Not rs.eof Then
			Dim tid,title,reply,name,hit,pid,type_
			Dim pagesize,count,page,pagecount,i
			Dim tip_'控制置顶和精铁标志
			PageSize=numbbslist
			Count=rs.recordcount
			page=getN("page",1)
			if page<=0 then page=1
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			rs.move(pagesize*(page-1))
			For i=1 To PageSize
				If rs.eof Then Exit For
				tip_=""
				tid=rs("id")
				title=rs("title")
				reply=rs("reply")
				name=rs("name")
				hit=rs("hit")
				Select Case act
					Case "new"
						type_=rs("type")
						If type_=1 Then tip_= showImg("jing")
					Case "good"
						tip_= showImg("jing")
					Case ""
						pid=rs("pid")
						If pid=1 Then tip_=showImg("ding")
						type_=rs("type")
						If type_=1 Then tip_= tip_&showImg("jing")
				End Select
				list=list& "<div class=""odd""><a href='"&http_path&"bbs_posts.asp?id="&tid&"&amp;"&a_sid&"&amp;p="&page&"&amp;act="&act&"'>"&tip_&(i+(page-1)*PageSize)&"."&nowml(rs("title"))&"</a></div>"&_
					"<div class=""even"">"&name&"(<a href='"&http_path&"bbs_replys.asp?id="&tid&"&amp;"&a_sid&"'>"&reply&"</a>/"&hit&")</div>"

				rs.moveNext
			Next
			list=list& showsPage("bbs_topic.asp", "aid:list,act:"&act&",id:"&id, page, pagecount)
			
		Else
			list= "暂时没有帖子"
		End If
		admin= "<br/>"&showImg("light")&"<a href="""&http_path&"bbs_board.asp?id="&id&"&amp;"&a_sid&""">版务</a>"
		If staff<>0 Then admin=admin& " 版主:<a href="""&http_path&"bbs_user.asp?id="&staff&"&amp;"&a_sid&""">"&getUserName(staff)&"</a>"
		Dim rndnum
		rndnum=time_r'要避免内容中有{}标签,需将{}转义
		tpl=Replace(tpl,"{","{_74hu_"&rndnum)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"ad4}",ad4txt,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"post}",post,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"admin}",admin,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"list}",list,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"theme}",theme,1,1)
		w tpl
	Else
		w "<title>论坛页面出错！</title></head><body><div class=""main"">没有这个论坛!"
	End If
	rs.close
	Set rs=Nothing
End Sub
' wap1.0发帖页面
Sub showPost
	checkLogin()'验证登录，要避免用户输入很多数据后发现自己没有登录
	Dim id,a,userid,b,count,rs,title,text,sql,author,now_
	now_=time_now
	id=getN("id",1)
	a=getN("a", 0)
	b=getN("b", 0)
	userid=userArr(0)
	Select Case a
		Case 0:'发表帖子
			w "<card title=""发表帖子""><p align="""&wapconst&""">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-"&_
				"<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&""">论坛</a>-发帖<br/>"
			w "帖子标题<br/><input type=""text"" name=""title"&time_r&""" maxlength=""20"" value=""""/><br/>内容(支持<a href="""&http_path&"bbs_post.asp?id="&id&_
				"&amp;"&a_sid&"&amp;a=-1"">UBB</a>)<br/><input type=""text"" name=""text"&time_r&""" maxlength="""&numtopicmax&""" value=""""/>"&_
				"<br/><anchor>提交<go href="""&http_path&"bbs_post.asp?a=10&amp;"&a_sid&"&amp;id="&id&""" method=""post"">"&_
				"<postfield name=""title"" value=""$(title"&time_r&")""/><postfield name=""text"" value=""$(text"&time_r&")""/></go></anchor>"&_
				"<br/>温馨提示：<br/>标题最长20字，内容字数"&numtopicmin&"~"&numtopicmax&"字"
		Case 10:'保存帖子
			title=getD("title","")
			text=getD("text","")
			w "<card title=""保存帖子""><p align="""&wapconst&""">"
			If title="" Or text="" Then wn "标题和内容不能为空！</p></card></wml>"
			If len(text)<numtopicmin*1 Then wn "内容字数必须大于"&numtopicmin&"！</p></card></wml>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			rs.open "select classid from 74hu_class where lx=3 and classid="&id,conn,1,1
			If Not rs.eof Then
				count = conn.execute("select count(id) from 74hu_topic where title='"&title&"' and content='"&text&"'")(0)
				If count<>"0" Then
					w "帖子已存在！请不要重复发表"
				Else
					sql="insert into 74hu_topic (title,content,userid,classid,savetime,livetime,hit,reply,type,pid,[access],edittype)values"&_
						"('"&title&"','"&text&"',"&userid&","&id&",'"&time_now&"','"&time_now&"',0,0,0,0,0,0)"
					conn.Execute(sql)
					conn.Execute("update 74hu_user set topic=topic+1 where id="&userid)
					w "发表成功！"
				End If
				w "<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&""">返回论坛</a>"
			Else
				w "论坛不存在!"
			End If
		Case 1:'编辑帖子
			w "<card title=""编辑帖子""><p align="""&wapconst&""">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-编辑<br/>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql="select t.title,t.content from 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) where t.id="&id&" and (t.userid="&userid&" or c.relid="&userid&")"
			rs.open sql,conn,1,1
			If Not rs.eof Then
				w "帖子标题<br/><input type=""text"" name=""title"&time_r&""" maxlength=""20"" value="""&rs("title")&"""/><br/>"&_
					"内容(支持<a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=-1"">UBB</a>)<br/>"&_
					"<input type=""text"" name=""text"&time_r&""" maxlength="""&numtopicmax&""" value="""&nowml(rs("content"))&"""/>"&_
					"<br/><anchor>提交<go href="""&http_path&"bbs_post.asp?a=11&amp;"&a_sid&"&amp;id="&id&""" method=""post"">"&_
					"<postfield name=""title"" value=""$(title"&time_r&")""/><postfield name=""text"" value=""$(text"&time_r&")""/></go></anchor>"
				w "<br/>温馨提示：<br/>标题最长20字，内容字数"&numtopicmin&"~"&numtopicmax&"字"
			Else
				w "帖子不存在或者已删除!"
			End If
		Case 11:'编辑帖子
			title=getD("title","")
			text=getD("text","")
			w "<card title=""编辑帖子""><p align="""&wapconst&""">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-编辑<br/>"
			If title="" Or text="" Then wn "标题和内容不能为空！</p></card></wml>"
			If len(text)<numtopicmin*1 Then wn "内容字数必须大于"&numtopicmin&"！</p></card></wml>"
			sql="update 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) set t.title='"&title&"',t.content='"&text&"',t.edittime='"&now_&"',t.livetime='"&now_&"' "&_
				"where t.id="&id&" and (t.userid="&userid&" or c.relid="&userid&")"
			conn.execute(sql)
			w "编辑成功!<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a>"
		Case 2:'删除帖子
			w "<card title=""删除帖子""><p align="""&wapconst&""">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-删除<br/>"
			w "你确定删除帖子?<br/><a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=12"">我确定</a><br/>"&_
				"<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回原帖</a>"
		Case 12:'删除帖子
			w "<card title=""删除帖子""><p align="""&wapconst&""">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-删帖<br/>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			rs.open "select t.* from 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) where t.id="&id&" and (t.userid="&userid&" or c.relid="&userid&")",conn,1,3
			If Not rs.eof Then
				author=rs("userid")
				If rs("type")=0 Then
					rs.delete
					rs.close
					Server.ScriptTimeOut=999999
					conn.execute("update 74hu_user set topic=topic-1 where id="&author)
					conn.execute("delete * from 74hu_reply where postid="&id)'删除回复
					w "帖子删除成功!"
				Else
					rs.close
					w "为了维护论坛的稳定,精华帖不能删除!"
				End If
			Else
				rs.close
				w "帖子已删除!"
			End If
			Set rs=Nothing
		Case 3:'加精帖子
			w "<card title=""帖子管理""><p align="""&wapconst&""">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-加精<br/>"
			sql="update 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) set t.type=1,t.edittime='"&now_&"' where t.id="&id&" and c.relid="&userid
			conn.execute(sql)
			w "加精成功!<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a>"
		Case 4:'取消加精帖子
			w "<card title=""帖子管理""><p align="""&wapconst&""">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-取消加精<br/>"
			sql="update 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) set t.type=0 where t.id="&id&" and c.relid="&userid
			conn.execute(sql)
			w "取消加精成功!<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a>"
		Case 5:'置顶帖子
			w "<card title=""帖子管理""><p align="""&wapconst&""">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-置顶<br/>"
			sql="update 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) set t.pid=1 where t.id="&id&" and c.relid="&userid
			conn.execute(sql)
			w "置顶成功!<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a>"
		Case 6:'取消置顶帖子
			w "<card title=""帖子管理""><p align="""&wapconst&""">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-取消置顶<br/>"
			sql="update 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) set t.pid=0 where t.id="&id&" and c.relid="&userid
			conn.execute(sql)
			w "取消置顶成功!<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a>"
		Case -1:'UBB说明
			w "<card title=""UBB功能""><p align="""&wapconst&""">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-UBB说明<br/>"&_
				"[br] 换行<br/>"&_
				"[url=网址]名字[/url] 链接<br/>"&_
				"[img]图片地址[/img] 图片<br/><br/>"&_
				"[color=颜色]文字[/color] 彩色字<br/>"&_
				"[u]文字[/u] 带下划线的文字<br/>"&_
				"[b]文字[/b] 加粗的文字<br/>"&_
				"[i]文字[/i] 倾斜的文字<br/><br/>"&_
				"[sid] 防断线标识<br/>"&_
				"[username] 当前会员名字"
	 End Select
	 w "<br/>"
End Sub
' wap2.0发帖页面
Sub showsPost
	checkLogin()'验证登录，要避免用户输入很多数据后发现自己没有登录
	Dim id,a,userid,b,count,rs,title,text,sql,author,now_
	now_=time_now
	id=getN("id",1)
	a=getN("a", 0)
	b=getN("b", 0)
	userid=userArr(0)
	Select Case a
		Case 0:'发表帖子
			w "<title>发表帖子</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-"&_
				"<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&""">论坛</a>-发帖</div>"
			w "<form name=""post"" action="""&http_path&"bbs_post.asp?a=10"" method=""post"">帖子标题<br/>"&_
				"<input type=""text"" name=""title"" maxlength=""20"" value=""""/><br/>"&_
				"内容(支持<a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=-1"">UBB</a>)"&_
				"<br/><input type=""text"" name=""text"" maxlength="""&numtopicmax&""" value=""""/>"&_
				"<input type=""hidden"" name=""id"" value="""&id&"""/><input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/>"&_
				"<br/><input type=""submit"" value=""提交""/></form>"
			w "<br/>温馨提示：<br/>标题最长20字，内容字数"&numtopicmin&"~"&numtopicmax&"字"
		Case 10:'保存帖子
			title=getD("title","")
			text=getD("text","")
			w "<title>保存帖子</title></head><body><div class=""main"">"
			If title="" Or text="" Then wn "标题和内容不能为空！</div></body></html>"
			If len(text)<numtopicmin*1 Then wn "内容字数必须大于"&numtopicmin&"！</div></body></html>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			rs.open "select classid from 74hu_class where lx=3 and classid="&id,conn,1,1
			If Not rs.eof Then
				count = conn.execute("select count(id) from 74hu_topic where title='"&title&"' and content='"&text&"'")(0)
				If count<>"0" Then
					w "帖子已存在！请不要重复发表"
				Else
					conn.Execute("insert into 74hu_topic (title,content,userid,classid,savetime,livetime,hit,reply,type,pid,[access],edittype)values('"&title&"','"&text&"',"&userid&","&id&",'"&time_now&"','"&time_now&"',0,0,0,0,0,0)")
					conn.Execute("update 74hu_user set topic=topic+1 where id="&userid)
					w "发表成功！"
				End If
				w "<a href="""&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&""">返回论坛</a>"
			Else
				w "没有这个论坛!"
			End If
		Case 1:'编辑帖子
			w "<title>编辑帖子</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-编辑</div>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql="select t.title,t.content from 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) where t.id="&id&" and (t.userid="&userid&" or c.relid="&userid&")"
			rs.open sql,conn,1,1
			If Not rs.eof Then
				w "<form name=""post"" action="""&http_path&"bbs_post.asp?a=11"" method=""post"">"&_
					"帖子标题<br/><input type=""text"" name=""title"" maxlength=""20"" value="""&rs("title")&"""/><br/>"&_
					"内容(支持<a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=-1"">UBB</a>)<br/>"&_
					"<input type=""text"" name=""text"" maxlength="""&numtopicmax&""" value="""&nowml(rs("content"))&"""/>"&_
					"<input type=""hidden"" name=""id"" value="""&id&"""/><input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/>"&_
					"<br/><input type=""submit"" value=""提交""/></form>"
				w "<br/>温馨提示：<br/>标题最长20字，内容字数"&numtopicmin&"~"&numtopicmax&"字"
			Else
				w "帖子不存在或者已删除!"
			End If
		Case 11:'编辑帖子
			title=getD("title","")
			text=getD("text","")
			w "<title>编辑帖子</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-编辑</div>"
			If title="" Or text="" Then wn "标题和内容不能为空！</div></body></html>"
			If len(text)<numtopicmin*1 Then wn "内容字数必须大于"&numtopicmin&"！</div></body></html>"
			sql="update 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) set t.title='"&title&"',t.content='"&text&"',t.edittime='"&now_&"',t.livetime='"&now_&"' "&_
				"where t.id="&id&" and (t.userid="&userid&" or c.relid="&userid&")"
			conn.execute(sql)
			w "编辑成功!<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a>"
		Case 2:'删除帖子
			w "<title>删除帖子</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-删除</div>"
			w "你确定删除帖子?<br/><a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=12"">我确定</a><br/>"&_
				"<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回原帖</a>"
		Case 12:'删除帖子
			w "<title>删除帖子</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-删帖</div>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			rs.open "select t.* from 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) where t.id="&id&" and (t.userid="&userid&" or c.relid="&userid&")",conn,1,3
			If Not rs.eof Then
				author=rs("userid")
				If rs("type")=0 Then
					rs.delete
					rs.close
					Server.ScriptTimeOut=999999
					conn.execute("update 74hu_user set topic=topic-1 where id="&author)
					conn.execute("delete * from 74hu_reply where postid="&id)'删除回复
					w "帖子删除成功!"
				Else
					rs.close
					w "为了维护论坛的稳定,精华帖不能删除!"
				End If
			Else
				rs.close
				w "帖子已删除!"
			End If
			Set rs=Nothing
		Case 3:'加精帖子
			w "<title>帖子管理</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-加精</div>"
			sql="update 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) set t.type=1,t.edittime='"&now_&"' where t.id="&id&" and c.relid="&userid
			conn.execute(sql)
			w "加精成功!<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a>"
		Case 4:'取消加精帖子
			w "<title>帖子管理</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-取消加精</div>"
			sql="update 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) set t.type=0 where t.id="&id&" and c.relid="&userid
			conn.execute(sql)
			w "取消加精成功!<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a>"
		Case 5:'置顶帖子
			w "<title>帖子管理</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-置顶</div>"
			sql="update 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) set t.pid=1 where t.id="&id&" and c.relid="&userid
			conn.execute(sql)
			w "置顶成功!<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a>"
		Case 6:'取消置顶帖子
			w "<title>帖子管理</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>"&_
				"-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">帖子</a>-取消置顶</div>"
			sql="update 74hu_topic t left join 74hu_class c on (t.classid=c.classid and lx=3) set t.pid=0 where t.id="&id&" and c.relid="&userid
			conn.execute(sql)
			w "取消置顶成功!<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a>"
		Case -1:'UBB说明
			w "<title>UBB功能</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-UBB说明</div>"&_
				"[br] 换行<br/>"&_
				"[url=网址]名字[/url] 链接<br/>"&_
				"[img]图片地址[/img] 图片<br/><br/>"&_
				"[color=颜色]文字[/color] 彩色字<br/>"&_
				"[u]文字[/u] 带下划线的文字<br/>"&_
				"[b]文字[/b] 加粗的文字<br/>"&_
				"[i]文字[/i] 倾斜的文字<br/><br/>"&_
				"[sid] 防断线标识<br/>"&_
				"[username] 当前会员名字"
	 End Select
	 w "<br/>"
End Sub
' wap1.0帖子页面
Sub showPosts
	Dim id,p,act,tpl
	id=getN("id",1)
	p=getN("p",1)
	act=getData("act")
	tpl=ubbcode(tplpost)
	Dim rs,sql
	Set rs=Server.CreateObject("ADODB.Recordset")
	sql = "select t.userid,t.title,t.content,t.hit,t.savetime,t.edittime,t.type,t.pid,u.name,c.class,c.classid,c.relid from "&_
		"((74hu_topic t left join 74hu_user u on t.userid=u.id) left join 74hu_class c on c.classid=t.classid) where t.id="&id
	rs.open sql,conn,1,3
	If Not rs.eof Then
		Dim title,hit,classid,userid,edittime,staff,pid,author,ad5txt,content,savetime,source,admin,discuss
		title=rs("title")
		hit=1
		if numbbshit>0 then
			Randomize
			hit=Int(Rnd*numbbshit)+1
		end if
		userid=userArr(0)
		hit=rs("hit")+hit
		classid=rs("classid")
		edittime=rs("edittime")
		author=rs("userid")
		staff=rs("relid")
		pid=rs("pid")
		rs("hit")=hit
		rs.update
		w "<card title="""&title&"""><p align="""&wapconst&"""><a id=""top"" name=""top""></a>"
		checkMsg()'信息
		w "-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-<a href="""&http_path&"bbs_topic.asp?id="&classid&"&amp;"&a_sid&""">"&rs("class")&_
			"</a>-帖子<br/>"
		ad5txt= getAD(5,1)
		content=bbsubb(rs("content"))
		source= "<a href="""&http_path&"bbs_user.asp?id="&author&"&amp;"&a_sid&""">"&rs("name")&"</a>"
		savetime=fordate(rs("savetime"))
		If edittime<>"" Then
			edittime=fordate(edittime)
		else
			edittime=""
		end if
		' w "人气："&hit&"<br/>"
		If rs("type")=0 Then
			If userid=author Or staff=userid Then admin= "管理：<a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=1"">编辑</a>"&_
				" <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=2"">删除</a>"
			If staff=userid Then
				admin=admin& " <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=3"">加精</a>"
				If pid=0 Then
					admin=admin& " <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=5"">置顶</a>"
				Else
					admin=admin& " <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=6"">取消置顶</a>"
				End If
			End If
		Else
			If staff=userid Then
				admin= "管理:<a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=4"">取消加精</a>"
				If pid=0 Then
					admin=admin& " <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=5"">置顶</a>"
				Else
					admin=admin& " <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=6"">取消置顶</a>"
				End If
			End If
			admin=admin& "<br/>本帖在"&fordate(edittime)&"被加为精华帖"
		End If
		' w "<br/>"
		Dim count,i
		count = conn.execute("select count(id) from 74hu_reply where postid="&id)(0)'1.2.7后换成帖子表中的回帖索引数
		sql = "select top 4 r.content,u.name from 74hu_reply r left join 74hu_user u on r.userid=u.id where postid="&id&" order by r.id desc"
		rs.close
		rs.open sql,conn,1,1
		If Not rs.eof Then
			For i=0 To 4
				If rs.eof Then Exit For
				discuss=discuss& (count - i)&"楼."&rs("name")&":"&getLeft(noubb(rs("content")),15)&"<br/>"
				rs.movenext
			Next
		End If
		discuss=discuss& "<a href="""&http_path&"bbs_replys.asp?id="&id&"&amp;"&a_sid&""">网友回复("&count&")</a><br/>"&_
			"<input type=""text"" name=""text"&time_r&""" value="""" maxlength="""&numreplymax&"""/><anchor><br/>提交"&_
			"<go href="""&http_path&"bbs_reply.asp?id="&id&"&amp;"&a_sid&""" method=""post"">"&_
			"<postfield name=""text"" value=""$(text"&time_r&")""/></go></anchor>"
		Dim rndnum
		rndnum=time_r'要避免内容中有{}标签,需将{}转义
		tpl=Replace(tpl,"{","{_74hu_"&rndnum)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"ad5}",ad5txt,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"time}",savetime,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"lasttime}",edittime,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"hit}",hit,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"source}",source,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"admin}",admin,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"title}",title,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"content}",content,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"discuss}",discuss,1,1)
		tpl=Replace(tpl,"修改：<br/>","",1,1)
		tpl=Replace(tpl,"<br/><br/>","<br/>")
		w tpl
	Else
		w "<card title=""出错！""><p align="""&wapconst&""">没有这篇文章！"
	End If
	rs.close
	Set rs=Nothing
End Sub
' wap2.0帖子页面
Sub showsPosts
	Dim id,p,act,tpl
	id=getN("id",1)
	p=getN("p",1)
	act=getData("act")
	tpl=ubbcode(tplpost)
	Dim rs,sql
	Set rs=Server.CreateObject("ADODB.Recordset")
	sql = "select t.userid,t.title,t.content,t.hit,t.savetime,t.edittime,t.type,t.pid,u.name,c.class,c.classid,c.relid from "&_
		"((74hu_topic t left join 74hu_user u on t.userid=u.id) left join 74hu_class c on c.classid=t.classid) where t.id="&id
	rs.open sql,conn,1,3
	If Not rs.eof Then
		Dim title,hit,classid,userid,edittime,staff,pid,author,ad5txt,content,savetime,source,admin,discuss
		title=rs("title")
		hit=1
		if numbbshit>1 then
			Randomize
			hit=Int(Rnd*numbbshit)+1
		end if
		userid=userArr(0)
		hit=rs("hit")+hit
		classid=rs("classid")
		edittime=rs("edittime")
		author=rs("userid")
		staff=rs("relid")
		pid=rs("pid")
		rs("hit")=hit
		rs.update
		w "<title>"&title&"</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
		checkMsg()'信息
		w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-<a href="""&http_path&"bbs_topic.asp?id="&classid&"&amp;"&a_sid&""">"&rs("class")&"</a>-帖子</div>"
		ad5txt= getAD(5,1)
		content=bbsubb(rs("content"))
		source= "<a href="""&http_path&"bbs_user.asp?id="&author&"&amp;"&a_sid&""">"&rs("name")&"</a>"
		savetime=fordate(rs("savetime"))
		If edittime<>"" Then
			edittime=fordate(edittime)
		else
			edittime=""
		end if
		If rs("type")=0 Then
			If userid=author Or staff=userid Then admin="管理：<a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=1"">编辑</a>"&_
				" <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=2"">删除</a>"
			If staff=userid Then
				admin=admin& " <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=3"">加精</a>"
				If pid=0 Then
					admin=admin& " <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=5"">置顶</a>"
				Else
					admin=admin& " <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=6"">取消置顶</a>"
				End If
			End If
		Else
			If staff=userid Then
				admin= "管理:<a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=4"">取消加精</a>"
				If pid=0 Then
					admin=admin& " <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=5"">置顶</a>"
				Else
					admin=admin& " <a href="""&http_path&"bbs_post.asp?id="&id&"&amp;"&a_sid&"&amp;a=6"">取消置顶</a>"
				End If
			End If
			admin=admin& "<br/>本帖在"&fordate(edittime)&"被加为精华帖"
		End If
		Dim count,i
		count = conn.execute("select count(id) from 74hu_reply where postid="&id)(0)'1.2.7后换成帖子表中的回帖索引数
		sql = "select top 4 r.content,u.name from 74hu_reply r left join 74hu_user u on r.userid=u.id where postid="&id&" order by r.id desc"
		rs.close
		rs.open sql,conn,1,1
		If Not rs.eof Then
			For i=0 To 4
				If rs.eof Then Exit For
				discuss=discuss& (count - i)&"楼."&rs("name")&":"&getLeft(noubb(rs("content")),15)&"<br/>"
				rs.movenext
			Next
		End If
		discuss=discuss& "<a href="""&http_path&"bbs_replys.asp?id="&id&"&amp;"&a_sid&""">网友回复("&count&")</a><br/>"&_
			"<form name=""re"" action="""&http_path&"bbs_reply.asp?id="&id&""" method=""post""><input type=""text"" name=""text"" value="""" maxlength="""&numreplymax&"""/>"&_
			"<input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/><input type=""submit"" value=""回复""/></form>"
		Dim rndnum
		rndnum=time_r'要避免内容中有{}标签,需将{}转义
		tpl=Replace(tpl,"{","{_74hu_"&rndnum)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"ad5}",ad5txt,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"time}",savetime,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"lasttime}",edittime,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"hit}",hit,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"source}",source,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"admin}",admin,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"title}",title,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"content}",content,1,1)
		tpl=Replace(tpl,"{_74hu_"&rndnum&"discuss}",discuss,1,1)
		tpl=Replace(tpl,"<br/>修改：</div>","</div>",1,1)
		tpl=Replace(tpl,"</div><br/>","</div>")
		w tpl

	Else
		w "<title>出错！</title></head><body><div class=""main"">没有这篇文章！"
	End If
	rs.close
	Set rs=Nothing
End Sub
' wap1.0帖子回复页面
Sub showReplys
	Dim id,rs,sql,isAdmin,userid
	id=getN("id", 1)
	userid=userArr(0)
	w "<card title=""网友跟帖""><p align="""&wapconst&""">"
	checkMsg()'信息
	w "-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">查看帖子</a>-跟帖<br/>"&_
		"发表评论：<br/><input type=""text"" name=""text"&time_r&""" value="""" maxlength="""&numreplymax&"""/><br/>"&_
		"<anchor>提交<go href="""&http_path&"bbs_reply.asp?id="&id&"&amp;"&a_sid&""" method=""post"">"&_
		"<postfield name=""text"" value=""$(text"&time_r&")""/></go></anchor><br/>※网友评论区<br/>"
	isAdmin=conn.execute("select count(t.id) from 74hu_topic t left join 74hu_class c on(c.classid=t.classid) where c.lx=3 and c.relid="&userid&" and t.id="&id)(0)
	Set rs=Server.CreateObject("ADODB.Recordset")
	sql = "select r.id,r.userid,r.content,r.savetime,u.name from 74hu_reply r left join 74hu_user u on r.userid=u.id where r.postid="&id&" order by r.id desc"
	rs.open sql,conn,1,1
	If Not rs.eof Then
		Dim pagesize,count,page,pagecount,i,rid
		pagesize=10
		count=rs.recordcount
		page=getN("page",1)
		if page<=0 then page=1
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		rs.move(pagesize*(page-1))
		For i=1 To PageSize
			If rs.eof Then Exit For
			rid=rs("id")
			w count-(page-1)*pagesize-i+1 &"楼.<a href="""&http_path&"bbs_user.asp?id="&rs("userid")&"&amp;"&a_sid&""">"& rs("name") &_
				"</a> "& fordate2(rs("savetime")) &"<br/>"& noubb(rs("content")) & "<br/>"
			If isAdmin<>0 Then w "管理:<a href='"&http_path&"bbs_reply.asp?id="&rid&"&amp;"&a_sid&"&amp;a=1&amp;pid="&id&"'>编辑</a>."&_
				"<a href='"&http_path&"bbs_reply.asp?id="&rid&"&amp;"&a_sid&"&amp;a=2&amp;pid="&id&"'>删除</a><br/>"
			rs.movenext
		Next
		w showsPage("bbs_replys.asp", "id:"&id, page, pagecount)&"<br/>"
	Else
		w "暂时没有回复!"
	End If
	rs.close
	Set rs=Nothing
End Sub
' wap2.0帖子回复页面
Sub showsReplys
	Dim id,rs,sql,isAdmin,userid
	id=getN("id", 1)
	userid=userArr(0)
	w "<title>网友跟帖</title></head><body><div class=""main"">"
	checkMsg()'信息
	w "<div class=""nav"">-<a href="""&http_path&"?aid=index&amp;"&a_sid&""">首页</a>-<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">查看帖子</a>-跟帖</div>"&_
		"发表评论：<br/><form name=""re"" action="""&http_path&"bbs_reply.asp?id="&id&""" method=""post"">"&_
		"<input type=""text"" name=""text"" value="""" maxlength="""&numreplymax&"""/>"&_
		"<input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/><input type=""submit"" value=""回复""/></form>"&_
		"<div class=""nav"">※网友评论区</div>"
	isAdmin=conn.execute("select count(t.id) from 74hu_topic t left join 74hu_class c on(c.classid=t.classid) where c.lx=3 and c.relid="&userid&" and t.id="&id)(0)
	Set rs=Server.CreateObject("ADODB.Recordset")
	sql = "select r.id,r.userid,r.content,r.savetime,u.name from 74hu_reply r left join 74hu_user u on r.userid=u.id where r.postid="&id&" order by r.id desc"
	rs.open sql,conn,1,1
	If Not rs.eof Then
		Dim pagesize,count,page,pagecount,i,rid
		pagesize=10
		count=rs.recordcount
		page=getN("page",1)
		if page<=0 then page=1
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		rs.move(pagesize*(page-1))
		For i=1 To PageSize
			If rs.eof Then Exit For
			rid=rs("id")
			w "<div class=""odd"">"&count-(page-1)*pagesize-i+1 &"楼.<a href="""&http_path&"bbs_user.asp?id="&rs("userid")&"&amp;"&a_sid&""">"& rs("name") &_
				"</a> "& fordate2(rs("savetime")) &"</div><div class=""even"">"& noubb(rs("content")) & "</div>"
			If isAdmin<>0 Then w "管理:<a href='"&http_path&"bbs_reply.asp?id="&rid&"&amp;"&a_sid&"&amp;a=1&amp;pid="&id&"'>编辑</a>."&_
				"<a href='"&http_path&"bbs_reply.asp?id="&rid&"&amp;"&a_sid&"&amp;a=2&amp;pid="&id&"'>删除</a><br/>"
			rs.movenext
		Next
		w showsPage("bbs_replys.asp", "id:"&id, page, pagecount)&"<br/>"
	Else
		w "暂时没有回复!"
	End If
	rs.close
	Set rs=Nothing
End Sub
' wap1.0回复帖子页面
Sub showReply
	checkLogin()'验证登录
	Dim id,text,userid,rs,a,sql,pid,author
	a=getN("a",0)
	id=getN("id", 1)
	userid=userArr(0)
	text=getD("text", "")
	pid=getN("pid",1)
	w "<card title=""回复帖子""><p align="""&wapconst&""">"
	Select Case a
	Case 0:'保存回帖
		If len(text)<numreplymin*1 Then wn "为提高回帖质量,字数必须大于"&numreplymin&"</p></card></wml>"
		Set rs=Server.CreateObject("ADODB.Recordset")
		rs.open "select id from 74hu_topic where id="&id,conn,1,1
		If Not rs.eof Then
			Dim count'防止刷帖,30秒回复一条
			count=conn.Execute("select count(id) from 74hu_reply where userid="&userid&" and (savetime>#"&dateadd("s", -30, time_now)&"#)")(0)
			If count>0 Then wn "为提高回帖质量,两次回帖间隔必须大于30秒!</p></card></wml>"
			conn.Execute("insert into 74hu_reply (content,userid,postid,savetime)values('"&text&"',"&userid&","&id&",'"&time_now&"')")
			conn.Execute("update 74hu_topic set reply=reply+1,livetime='"&time_now&"' where id="&id)
			conn.Execute("update 74hu_user set reply=reply+1 where id="&userid)
			w "发表成功！<br/><a href="""&http_path&"bbs_replys.asp?id="&id&"&amp;"&a_sid&""">查看回复</a><br/>"&_
				"<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a><br/>"
		Else
			w "没有这个帖子！<br/>"
		End If
		rs.close
		Set rs=Nothing
	Case 1:'修改回帖
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql="select r.content from (74hu_reply r left join 74hu_topic t on (t.id=r.postid)) left join 74hu_class c on "&_
			"(c.classid=t.classid) where c.lx=3 and c.relid="&userid&" and r.id="&id
		rs.open sql,conn,1,1
		If Not rs.eof Then
			w "回帖修改:<br/><input name='text"&time_r&"' value='"&nowml(rs("content"))&"'/><br/>"&_
				"<anchor>修改<go method='post' href='"&http_path&"bbs_reply.asp?id="&id&"&amp;"&a_sid&"&amp;a=11&amp;pid="&pid&"'>"&_
				"<postfield name='text' value='$(text"&time_r&")'/></go></anchor>"
		Else
			w "没有这个回帖！<br/><a href="""&http_path&"bbs_posts.asp?id="&pid&"&amp;"&a_sid&""">返回帖子</a><br/>"
		End If
		rs.close
		Set rs=Nothing
	Case 11:'修改回帖
		If text="" Then wn "内容不能为空！</p></card></wml>"
		sql="update (74hu_reply r left join 74hu_topic t on (r.postid=t.id)) left join 74hu_class c on(c.classid=t.classid) "&_
			"set r.content='"&text&"' where c.lx=3 and r.id="&id&" and c.relid="&userid
		conn.execute(sql)
		w "修改成功！<a href="""&http_path&"bbs_posts.asp?id="&pid&"&amp;"&a_sid&""">返回帖子</a><br/>"
	Case 2:'删除回帖
		w "确定删除回帖？<br/><a href="""&http_path&"bbs_reply.asp?id="&id&"&amp;"&a_sid&"&amp;a=12&amp;pid="&pid&""">删除回帖</a> "&_
			"<a href="""&http_path&"bbs_posts.asp?id="&pid&"&amp;"&a_sid&""">返回帖子</a><br/>"
	Case 12:'删除回帖
		sql="select r.* from (74hu_reply r left join 74hu_topic t on (r.postid=t.id)) left join 74hu_class c on(c.classid=t.classid) "&_
			"where c.lx=3 and r.id="&id&" and c.relid="&userid
		Set rs=Server.CreateObject("ADODB.Recordset")
		rs.open sql,conn,1,3
		If Not rs.eof Then
			author=rs("userid")
			rs.delete
			rs.close
			conn.execute("update 74hu_user set reply=reply-1 where id="&author)'回帖数减1
			conn.execute("update 74hu_topic set reply=reply-1 where id="&pid)'回帖数减1
			w "删除成功！"
		Else
			rs.close
			w "回帖不存在或已删除！"
		End If
		w "<a href="""&http_path&"bbs_posts.asp?id="&pid&"&amp;"&a_sid&""">返回帖子</a><br/>"
		Set rs=Nothing
	End Select
End Sub
' wap2.0回复帖子页面
Sub showsReply
	checkLogin()'验证登录
	Dim id,text,userid,rs,a,sql,pid,author
	a=getN("a",0)
	id=getN("id", 1)
	userid=userArr(0)
	text = getD("text", "")
	pid=getN("pid",1)
	w "<title>回复帖子</title></head><body><div class=""main"">"
	Select Case a
	Case 0:'保存回帖
		If len(text)<numreplymin*1 Then wn "为提高回帖质量,字数必须大于"&numreplymin&"</div></body></html>"
		Set rs=Server.CreateObject("ADODB.Recordset")
		rs.open "select id from 74hu_topic where id="&id,conn,1,1
		If Not rs.eof Then
			Dim count'防止刷帖,30秒回复一条
			count=conn.Execute("select count(id) from 74hu_reply where userid="&userid&" and (savetime>#"&dateadd("s", -30, time_now)&"#)")(0)
			If count>0 Then wn "为提高回帖质量,两次回帖间隔必须大于30秒!</div></body></html>"
			conn.Execute("insert into 74hu_reply (content,userid,postid,savetime)values('"&text&"',"&userArr(0)&","&id&",'"&time_now&"')")
			conn.Execute("update 74hu_topic set reply=reply+1,livetime='"&time_now&"' where id="&id)
			conn.Execute("update 74hu_user set reply=reply+1 where id="&userArr(0))
			w "发表成功！<br/><a href="""&http_path&"bbs_replys.asp?id="&id&"&amp;"&a_sid&""">查看回复</a><br/>"&_
				"<a href="""&http_path&"bbs_posts.asp?id="&id&"&amp;"&a_sid&""">返回帖子</a><br/>"
		Else
			w "没有这个帖子！<br/>"
		End If
		rs.close
		Set rs=Nothing
	Case 1:'修改回帖
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql="select r.content from (74hu_reply r left join 74hu_topic t on (t.id=r.postid)) left join 74hu_class c on "&_
			"(c.classid=t.classid) where c.lx=3 and c.relid="&userid&" and r.id="&id
		rs.open sql,conn,1,1
		If Not rs.eof Then
			w "回帖修改:<br/><form method='post' action='"&http_path&"bbs_reply.asp?id="&id&"&amp;"&a_sid&"&amp;a=11&amp;pid="&pid&"'>"&_
				"<input name='text' value='"&nowml(rs("content"))&"'/><br/><input type='submit' value='修改'/></from>"
		Else
			w "没有这个回帖！<br/><a href="""&http_path&"bbs_posts.asp?id="&pid&"&amp;"&a_sid&""">返回帖子</a><br/>"
		End If
		rs.close
		Set rs=Nothing
	Case 11:'修改回帖
		If text="" Then wn "内容不能为空！</div></body></html>"
		sql="update (74hu_reply r left join 74hu_topic t on (r.postid=t.id)) left join 74hu_class c on(c.classid=t.classid) "&_
			"set r.content='"&text&"' where c.lx=3 and r.id="&id&" and c.relid="&userid
		conn.execute(sql)
		w "修改成功！<a href="""&http_path&"bbs_posts.asp?id="&pid&"&amp;"&a_sid&""">返回帖子</a><br/>"
	Case 2:'删除回帖
		w "确定删除回帖？<br/><a href="""&http_path&"bbs_reply.asp?id="&id&"&amp;"&a_sid&"&amp;a=12&amp;pid="&pid&""">删除回帖</a> "&_
			"<a href="""&http_path&"bbs_posts.asp?id="&pid&"&amp;"&a_sid&""">返回帖子</a><br/>"
	Case 12:'删除回帖
		sql="select r.* from (74hu_reply r left join 74hu_topic t on (r.postid=t.id)) left join 74hu_class c on(c.classid=t.classid) "&_
			"where c.lx=3 and r.id="&id&" and c.relid="&userid
		Set rs=Server.CreateObject("ADODB.Recordset")
		rs.open sql,conn,1,3
		If Not rs.eof Then
			author=rs("userid")
			rs.delete
			rs.close
			conn.execute("update 74hu_user set reply=reply-1 where id="&author)'回帖数减1
			conn.execute("update 74hu_topic set reply=reply-1 where id="&pid)'回帖数减1
			w "删除成功！"
		Else
			rs.close
			w "回帖不存在或已删除！"
		End If
		w "<a href="""&http_path&"bbs_posts.asp?id="&pid&"&amp;"&a_sid&""">返回帖子</a><br/>"
		Set rs=Nothing
	End Select
End Sub
' wap1.0用户页面
Sub showUser
	Dim id,rs,sql,birth,userid
	id=getN("id", 0)
	userid=userArr(0)
	checkLogin()'验证登录
	w "<card title=""用户页面""><p align="""&wapconst&"""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	If id=0 Or id=userid Then
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select u.sex,u.name,u.remark,u.city,u.logtime,u.birthday,u.topic,u.reply,c.class as bbs,c.classid as bbsid from 74hu_user u left join "&_
			"74hu_class c on (u.id=c.relid and lx=3) where u.id="&userid
		rs.open sql,conn,1,1
		If Not rs.eof Then
			birth = rs("birthday")
			w ""&noubb(rs("name"))&" ("&userid&") <a href="""&http_path&"bbs_logout.asp?"&a_sid&""">安全退出</a><br/>"&_
				""&showImg("msgto")&"<a href="""&http_path&"bbs_msgs.asp?id="&id&"&amp;"&a_sid&""">聊天记录</a> "&_
				showImg("friend")&"<a href="""&http_path&"bbs_friend.asp?"&a_sid&""">我的好友</a><br/>"&_
				showImg("edit")&"<a href="""&http_path&"bbs_password.asp?"&a_sid&""">修改密码</a>."&_
				"<a href="""&http_path&"bbs_username.asp?"&a_sid&""">用户名</a>."&_
				"<a href="""&http_path&"bbs_data.asp?"&a_sid&""">资料</a><br/>"
			If ifNum(rs("bbsid")) Then w "特权：<a href="""&http_path&"bbs_topic.asp?id="&rs("bbsid")&"&amp;"&a_sid&""">"&nowml(rs("bbs"))&"</a>版主<br/>"
			w "性别："&getSex(rs("sex"))&"<br/>"&_
				"签名："&getRemark(rs("remark"))&"<br/>"&_
				"城市："&noubb(rs("city"))&"<br/>"&_
				"年龄："&getAge(birth)&"岁<br/>"&_
				"生日："&birth&"<br/>"&_
				"帖子：<a href="""&http_path&"bbs_mypost.asp?"&a_sid&""">"&rs("topic")&" 篇</a><br/>"
			If bbsessay=1 Then w "文章：<a href="""&http_path&"bbs_myessay.asp?"&a_sid&""">"&getEssay(userid)&" 篇</a><br/>"
			w "最后在线: "&noubb(rs("logtime"))&"<br/>"&_
				"会员ID号:<br/><input type=""text"" name=""id"&time_r&""" value=""""/><br/>"&_
				"<anchor>查找会员<go href="""&http_path&"bbs_user.asp?"&a_sid&""" method=""get"">"&_
				"<postfield name=""id"" value=""$(id"&time_r&")""/></go></anchor><br/>"
		End If
		rs.close
		Set rs= Nothing
	Else
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select sex,name,remark,city,logtime,birthday,topic,reply from 74hu_user where id="&id
		sql = "select u.sex,u.name,u.remark,u.city,u.logtime,u.birthday,u.topic,u.reply,c.class as bbs,c.classid as bbsid from 74hu_user u left join "&_
			"74hu_class c on (u.id=c.relid and lx=3) where u.id="&id
		rs.open sql,conn,1,1
		If Not rs.eof Then
			birth = rs("birthday")
			w "<a href="""&http_path&"bbs_user.asp?"&a_sid&""">"&noubb(rs("name"))&" ("&id&")</a><br/>"&_
				""&showImg("msgto")&"<a href="""&http_path&"bbs_msg.asp?id="&id&"&amp;"&a_sid&""">发信息</a> "&showImg("friend")&_
				"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&""">加好友</a><br/>"
			If ifNum(rs("bbsid")) Then w "特权：<a href="""&http_path&"bbs_topic.asp?id="&rs("bbsid")&"&amp;"&a_sid&""">"&nowml(rs("bbs"))&"</a>版主<br/>"
			w "性别："&getSex(rs("sex"))&"<br/>"&_
				"签名："&getRemark(rs("remark"))&"<br/>"&_
				"城市："&noubb(rs("city"))&"<br/>"&_
				"年龄："&getAge(birth)&"岁<br/>"&_
				"生日："&birth&"<br/>"&_
				"帖子：<a href="""&http_path&"bbs_mypost.asp?id="&id&"&amp;"&a_sid&""">"&rs("topic")&" 篇</a><br/>"
			If bbsessay=1 Then w "文章：<a href="""&http_path&"bbs_myessay.asp?id="&id&"amp;"&a_sid&""">"&getEssay(id)&" 篇</a><br/>"
			w "最后在线: "&fordate(rs("logtime"))&"<br/>"&_
				"会员ID号:<br/><input type=""text"" name=""id"&time_r&""" value=""""/><br/>"&_
				"<anchor>查找会员<go href="""&http_path&"bbs_user.asp?"&a_sid&""" method=""get"">"&_
				"<postfield name=""id"" value=""$(id"&time_r&")""/></go></anchor><br/>"
		Else
			w "-<a href="""&http_path&"?"&a_sid&""">首页</a>-<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-查找会员<br/>没有这个会员!"
		End If
		rs.close
		Set rs=Nothing
		w "<br/>"
	End If
End Sub
' wap2.0用户页面
Sub showsUser
	Dim id,rs,sql,birth,userid
	id=getN("id", 0)
	userid=userArr(0)
	checkLogin()'验证登录
	w "<title>用户页面</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	If id=0 Or id=userid Then
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select u.sex,u.name,u.remark,u.city,u.logtime,u.birthday,u.topic,u.reply,c.class as bbs,c.classid as bbsid from 74hu_user u left join "&_
			"74hu_class c on (u.id=c.relid and lx=3) where u.id="&userid
		rs.open sql,conn,1,1
		If Not rs.eof Then
			birth = rs("birthday")
			w "<div class=""even"">"&noubb(rs("name"))&" ("&userid&") <a href="""&http_path&"bbs_logout.asp?"&a_sid&""">安全退出</a></div>"&_
				"<div class=""odd"">"&showImg("msgto")&"<a href="""&http_path&"bbs_msgs.asp?id="&id&"&amp;"&a_sid&""">聊天记录</a> "&_
				showImg("friend")&"<a href="""&http_path&"bbs_friend.asp?"&a_sid&""">我的好友</a><br/>"&_
				showImg("edit")&"<a href="""&http_path&"bbs_password.asp?"&a_sid&""">修改密码</a>."&_
				"<a href="""&http_path&"bbs_username.asp?"&a_sid&""">用户名</a>."&_
				"<a href="""&http_path&"bbs_data.asp?"&a_sid&""">资料</a>"
			If ifNum(rs("bbsid")) Then w "<br/>特权：<a href="""&http_path&"bbs_topic.asp?id="&rs("bbsid")&"&amp;"&a_sid&""">"&nowml(rs("bbs"))&"</a>版主"
			w "</div><div class=""even"">性别："&getSex(rs("sex"))&"</div>"&_
				"<div class=""odd"">签名："&getRemark(rs("remark"))&"</div>"&_
				"<div class=""even"">城市："&noubb(rs("city"))&"</div>"&_
				"<div class=""odd"">年龄："&getAge(birth)&"岁</div>"&_
				"<div class=""even"">生日："&birth&"</div>"&_
				"<div class=""odd"">帖子：<a href="""&http_path&"bbs_mypost.asp?"&a_sid&""">"&rs("topic")&" 篇</a>"
			If bbsessay=1 Then w "<br/>文章：<a href="""&http_path&"bbs_myessay.asp?"&a_sid&""">"&getEssay(userid)&" 篇</a>"
			w "</div><div class=""even"">最后在线: "&noubb(rs("logtime"))&"</div>"&_
				"<div class=""odd"">会员ID号:<br/><form action="""&http_path&"bbs_user.asp"" method=""get"">"&_
				"<input type=""text"" name=""id"" value="""" style=""width:80px;""/><input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/>"&_
				" <input type=""submit"" value=""查找会员""/></form></div>"
		End If
		rs.close
		Set rs= Nothing
	Else
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select u.sex,u.name,u.remark,u.city,u.logtime,u.birthday,u.topic,u.reply,c.class as bbs,c.classid as bbsid from 74hu_user u left join "&_
			"74hu_class c on (u.id=c.relid and lx=3) where u.id="&id
		rs.open sql,conn,1,1
		If Not rs.eof Then
			birth = rs("birthday")
			w "<div class=""even""><a href="""&http_path&"bbs_user.asp?"&a_sid&""">"&noubb(rs("name"))&" ("&id&")</a></div>"&_
				"<div class=""odd"">"&showImg("msgto")&"<a href="""&http_path&"bbs_msg.asp?id="&id&"&amp;"&a_sid&""">发信息</a> "&showImg("friend")&_
				"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&""">加好友</a>"
			If ifNum(rs("bbsid")) Then w "<br/>特权：<a href="""&http_path&"bbs_topic.asp?id="&rs("bbsid")&"&amp;"&a_sid&""">"&nowml(rs("bbs"))&"</a>版主"
			w "</div><div class=""even"">性别："&getSex(rs("sex"))&"</div>"&_
				"<div class=""odd"">签名："&getRemark(rs("remark"))&"</div>"&_
				"<div class=""even"">城市："&noubb(rs("city"))&"</div>"&_
				"<div class=""odd"">年龄："&getAge(birth)&"岁</div>"&_
				"<div class=""even"">生日："&birth&"</div>"&_
				"<div class=""odd"">帖子：<a href="""&http_path&"bbs_mypost.asp?id="&id&"&amp;"&a_sid&""">"&rs("topic")&" 篇</a>"
			If bbsessay=1 Then w  "<br/>文章：<a href="""&http_path&"bbs_myessay.asp?id="&id&"&amp;"&a_sid&""">"&getEssay(id)&" 篇</a>"
			w "</div><div class=""even"">最后在线: "&fordate(rs("logtime"))&"</div>"&_
				"<div class=""odd"">会员ID号:<br/><form action="""&http_path&"bbs_user.asp"" method=""get"">"&_
				"<input type=""text"" name=""id"" value="""" style=""width:80px;""/><input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/>"&_
				" <input type=""submit"" value=""查找会员""/></form></div>"
		Else
			w "<div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-查找会员</div>没有这个会员!"
		End If
		rs.close
		Set rs=Nothing
		w "<br/>"
	End If
End Sub
' wap1.0好友页面
Sub showFriend
	checkLogin()'验证登录
	Dim id,rs,sql,count,a,userid
	w "<card title=""好友页面""><p align="""&wapconst&"""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	w "-<a href="""&http_path&"?"&a_sid&""">首页</a>-<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-"
	id=getN("id", 0)
	a=getN("a",0)
	userid=userArr(0)
	If id=0 Or id=userid Then
		Dim pagesize,page,pagecount,i,remark
		page=getN("page",1)
		if page<=0 then page=1
		pagesize=10
		Select Case a
			Case 0:'我的好友列表
				w "我的好友<br/>"
				Set rs=Server.CreateObject("ADODB.Recordset")
				sql = "select f.fid,u.name,u.remark from (74hu_friend f left join 74hu_user u on f.fid=u.id) where f.uid="&userid&" and f.state=1"
				rs.open sql,conn,1,1
				If Not rs.eof Then
					count=rs.recordcount
					w "共"&count&"名好友<br/>"
					pagecount=(count+pagesize-1)\pagesize
					if page>pagecount then page=pagecount
					rs.move(pagesize*(page-1))
					For i=1 To PageSize
						If rs.eof Then Exit For
						id =rs("fid")
						remark=rs("remark")
						If remark<>"" Then remark = remark &"<br/>"
						w (page-1)*pagesize+i&".<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &"</a><br/>"& remark &_
							""&showImg("msgto")&"<a href="""&http_path&"bbs_msg.asp?id="&id&"&amp;"&a_sid&""">发信息</a> "&showImg("edit")&_
							"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=11"">管理好友</a><br/>"
						rs.movenext
					Next
					w showsPage("bbs_friend.asp", "", page, pagecount)&""
				Else
					w "暂时没有好友<br/>"
				End If
				rs.close
				Set rs=Nothing
			Case 1:'好友请求
				w "好友请求<br/>"
				Set rs=Server.CreateObject("ADODB.Recordset")
				sql = "select f.fid,u.name,u.remark from 74hu_friend f left join 74hu_user u on f.fid=u.id where f.uid="&userid&" and f.state=0"
				rs.open sql,conn,1,1
				If Not rs.eof Then
					count=rs.recordcount
					w "共"&count&"条好友请求<br/>"
					pagecount=(count+pagesize-1)\pagesize
					if page>pagecount then page=pagecount
					rs.move(pagesize*(page-1))
					For i=1 To PageSize
						If rs.eof Then Exit For
						id =rs("fid")
						remark=rs("remark")
						If remark<>"" Then remark = remark &"<br/>"
						w (page-1)*pagesize+i&".<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &"</a><br/>"& remark &_
							""&showImg("edit")&"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=1"">同意请求</a> "&_
							"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=3"">忽略</a> "&_
							"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=2"">拒绝此人</a><br/>"
						rs.movenext
					Next
					w showsPage("bbs_friend.asp", "a:1", page, pagecount)&""
				Else
					w "暂时没有好友请求<br/>"
				End If
				rs.close
				Set rs=Nothing
			Case 2:'黑名单
				w "黑名单<br/>"
				Set rs=Server.CreateObject("ADODB.Recordset")
				sql = "select f.fid,u.name,u.remark from 74hu_friend f left join 74hu_user u on f.fid=u.id where f.uid="&userid&" and f.state=2"
				rs.open sql,conn,1,1
				If Not rs.eof Then
					count=rs.recordcount
					w "共"&count&"名好友<br/>"
					pagecount=(count+pagesize-1)\pagesize
					if page>pagecount then page=pagecount
					rs.move(pagesize*(page-1))
					For i=1 To PageSize
						If rs.eof Then Exit For
						id =rs("fid")
						remark=rs("remark")
						If remark<>"" Then remark = remark &"<br/>"
						w (page-1)*pagesize+i&".<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &"</a><br/>"& remark &_
							""&showImg("edit")&"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=3"">取消加黑</a><br/>"
						rs.movenext
					Next
					w showsPage("bbs_friend.asp", "a:2", page, pagecount)&""
				Else
					w "暂时没有黑名单<br/>"
				End If
				rs.close
				Set rs=Nothing
		End Select
		w "※功能面板<br/><a href="""&http_path&"bbs_friend.asp?"&a_sid&""">我的好友</a> <a href="""&http_path&"bbs_friend.asp?a=1&amp;"&a_sid&""">好友请求</a> "&_
			"<a href="""&http_path&"bbs_friend.asp?a=2&amp;"&a_sid&""">黑名单</a>"
	Else'好友页面
		Dim now_
		now_=time_now
		If id=userid Then wn "不能加自己为好友!</p></card></wml>"
		count=conn.execute("select count(id) from 74hu_user where id="&id)(0)
		If count=0 Then wn "没有这个会员!</p></card></wml>"
		Select Case a
		Case 0:
			w "添加好友<br/>"
			Dim state
			state= getFriendship(id)'以对方信息为准
			Select Case state
				Case 0: w "已提交好友申请,等待对方审核<br/>"
				Case 1: w "他(她)是你的好友,可直接<a href="""&http_path&"bbs_msg.asp?id="&id&"&amp;"&a_sid&""">发信息</a><br/>"
				Case 2: w "你已被拒绝,请不要再打扰他(她)<br/>"
				Case -1:w "<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=10"">提出好友申请</a><br/>"
			End Select
		Case 10:
			w "添加好友<br/>"
			' count=conn.execute("select count(id) from 74hu_friend where fid="&id&" and uid="&userid)(0)
			count=conn.execute("select count(id) from 74hu_friend where uid="&id&" and fid="&userid)(0)'以对方信息为准
			If count>0 Then
				w "你已提交过申请,请不要重复提交,"
			Else
				conn.execute("insert into 74hu_friend (uid,fid,state) values("&userid&","&id&",-1)")'TODO
				conn.execute("insert into 74hu_friend (fid,uid,state) values("&userid&","&id&",0)")
				w "你已成功提交好友申请,等待对方审核,"
			End If
		Case 11:'管理好友
			w "管理好友<br/>"&_
				"知己难求,请谨慎操作<br/>"&_
				"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=3"">删除好友</a><br/>"&_
				"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=2"">加黑好友</a><br/>"
		Case 1:'同意好友
			w "好友请求<br/>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select state,retime from 74hu_friend where uid="&id&" and fid="&userid&" and state=-1"'避免修改对方的黑名单
			rs.open sql,conn,1,3
			If Not rs.eof Then
				rs("state")=1
				rs("retime")=now_
				rs.update
				rs.close
				sql = "select state,retime from 74hu_friend where uid="&userid&" and fid="&id&""
				rs.open sql,conn,1,3
				If Not rs.eof Then
					rs("state")=1
					rs("retime")=now_
					rs.update
				Else
					'不存在好友关系则添加
					conn.execute("insert into 74hu_friend (uid,fid,state,retime) values("&userid&","&id&",1,'"&now_&"')")
				End If
				w "已同意请求,"
			Else
				w "已没有好友请求,"
			End If
			rs.close
			Set rs=Nothing
		Case 2:'加黑名单
			w "黑名单<br/>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select state,retime from 74hu_friend where uid="&userid&" and fid="&id&""
			rs.open sql,conn,1,3
			If Not rs.eof Then
				rs("state")=2
				rs("retime")=now_
				rs.update
				rs.close
				Set rs=Nothing
			Else
				rs.close
				Set rs=Nothing
				'不存在好友关系则添加
				conn.execute("insert into 74hu_friend (uid,fid,retime,state) values("&userid&","&id&",'"&now_&"',2)")
			End If
			conn.execute("delete * from 74hu_friend where uid="&id&" and fid="&userid&" and state<>2")'避免修改对方的黑名单
			w "已加对方黑名单!<br/>"
		Case 3:'删除好友
			w"删除好友<br/>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select uid from 74hu_friend where uid="&id&" and fid="&userid&" and state=2"'避免修改对方的黑名单
			rs.open sql,conn,3,1
			If rs.eof Then
				rs.close
				Set rs=Nothing
				conn.execute("delete * from 74hu_friend where uid="&id&" and fid="&userid&"")
			End If
			conn.execute("delete * from 74hu_friend where uid="&userid&" and fid="&id&"")
			w "删除成功!<br/>"
		' Case 20:'取消加黑 改成 直接删除
			' w "黑名单</div>"
			' Set rs=Server.CreateObject("ADODB.Recordset")
			' sql = "select state from 74hu_friend where uid="&userid&" and fid="&id&" and state=2"
			' rs.open sql,conn,3,1
			' If Not rs.eof Then
				' state=2
				' rs("retime")=now_
				' w "取消黑名单成功!<br/>"
			' Else
				' w "你没有把对方加进黑名单!<br/>"
			' End If
		End Select
	w "<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">返回他(她)的页面</a><br/>"&_
		"<a href="""&http_path&"bbs_friend.asp?"&a_sid&""">我的好友列表</a><br/>"
	End If
End Sub
' wap2.0好友页面
Sub showsFriend
	checkLogin()'验证登录
	Dim id,rs,sql,count,a,userid
	w "<title>好友页面</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	w "<div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-"
	id=getN("id", 0)
	a=getN("a",0)
	userid=userArr(0)
	If id=0 Or id=userid Then
		Dim pagesize,page,pagecount,i
		page=getN("page",1)
		if page<=0 then page=1
		pagesize=10
		Select Case a
			Case 0:'我的好友列表
				w "我的好友</div>"
				Set rs=Server.CreateObject("ADODB.Recordset")
				sql = "select f.fid,u.name,u.remark from (74hu_friend f left join 74hu_user u on f.fid=u.id) where f.uid="&userid&" and f.state=1"
				rs.open sql,conn,1,1
				If Not rs.eof Then
					count=rs.recordcount
					w "共"&count&"名好友<br/>"
					pagecount=(count+pagesize-1)\pagesize
					if page>pagecount then page=pagecount
					rs.move(pagesize*(page-1))
					For i=1 To PageSize
						If rs.eof Then Exit For
						id =rs("fid")
						w "<div class=""odd""><a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &"</a><br/>"& rs("remark") & "</div>"&_
							"<div class=""even"">"&showImg("msgto")&"<a href="""&http_path&"bbs_msg.asp?id="&id&"&amp;"&a_sid&""">发信息</a> "&showImg("edit")&_
							"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=11"">管理好友</a></div>"
						rs.movenext
					Next
					w showsPage("bbs_friend.asp", "", page, pagecount)&""
				Else
					w "暂时没有好友<br/>"
				End If
				rs.close
				Set rs=Nothing
			Case 1:'好友请求
				w "好友请求</div>"
				Set rs=Server.CreateObject("ADODB.Recordset")
				sql = "select f.fid,u.name,u.remark from 74hu_friend f left join 74hu_user u on f.fid=u.id where f.uid="&userid&" and f.state=0"
				rs.open sql,conn,1,1
				If Not rs.eof Then
					count=rs.recordcount
					w "共"&count&"条好友请求<br/>"
					pagecount=(count+pagesize-1)\pagesize
					if page>pagecount then page=pagecount
					rs.move(pagesize*(page-1))
					For i=1 To PageSize
						If rs.eof Then Exit For
						id =rs("fid")
						w "<div class=""odd""><a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &"</a><br/>"& rs("remark") & "</div>"&_
							"<div class=""even"">"&showImg("edit")&"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=1"">同意请求</a> "&_
							"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=3"">忽略</a> "&_
							"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=2"">拒绝此人</a></div>"
						rs.movenext
					Next
					w showsPage("bbs_friend.asp", "a:1", page, pagecount)&""
				Else
					w "暂时没有好友请求<br/>"
				End If
				rs.close
				Set rs=Nothing
			Case 2:'黑名单
				w "黑名单</div>"
				Set rs=Server.CreateObject("ADODB.Recordset")
				sql = "select f.fid,u.name,u.remark from 74hu_friend f left join 74hu_user u on f.fid=u.id where f.uid="&userid&" and f.state=2"
				rs.open sql,conn,1,1
				If Not rs.eof Then
					count=rs.recordcount
					w "共"&count&"名好友<br/>"
					pagecount=(count+pagesize-1)\pagesize
					if page>pagecount then page=pagecount
					rs.move(pagesize*(page-1))
					For i=1 To PageSize
						If rs.eof Then Exit For
						id =rs("fid")
						w "<div class=""odd""><a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &"</a><br/>"& rs("remark") & "</div>"&_
							"<div class=""even"">"&showImg("edit")&"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=3"">取消加黑</a></div>"
						rs.movenext
					Next
					w showsPage("bbs_friend.asp", "a:2", page, pagecount)&""
				Else
					w "暂时没有黑名单<br/>"
				End If
				rs.close
				Set rs=Nothing
		End Select
		w "<div class=""nav"">※功能面板</div><a href="""&http_path&"bbs_friend.asp?"&a_sid&""">我的好友</a> <a href="""&http_path&"bbs_friend.asp?a=1&amp;"&a_sid&""">好友请求</a> "&_
			"<a href="""&http_path&"bbs_friend.asp?a=2&amp;"&a_sid&""">黑名单</a>"
	Else'好友页面
		Dim now_
		now_=time_now
		If id=userid Then wn "不能加自己为好友!</div></body></html>"
		count=conn.execute("select count(id) from 74hu_user where id="&id)(0)
		If count=0 Then wn "没有这个会员!</div></body></html>"
		Select Case a
		Case 0:
			w "添加好友</div>"
			Dim state
			state= getFriendship(id)'以对方信息为准
			Select Case state
				Case 0: w "已提交好友申请,等待对方审核<br/>"
				Case 1: w "他(她)是你的好友,可直接<a href="""&http_path&"bbs_msg.asp?id="&id&"&amp;"&a_sid&""">发信息</a><br/>"
				Case 2: w "你已被拒绝,请不要再打扰他(她)<br/>"
				Case -1:w "<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=10"">提出好友申请</a><br/>"
			End Select
		Case 10:
			w "添加好友</div>"
			' count=conn.execute("select count(id) from 74hu_friend where fid="&id&" and uid="&userid)(0)
			count=conn.execute("select count(id) from 74hu_friend where uid="&id&" and fid="&userid)(0)'以对方信息为准
			If count>0 Then
				w "你已提交过申请,请不要重复提交,"
			Else
				conn.execute("insert into 74hu_friend (uid,fid,state) values("&userid&","&id&",-1)")'TODO
				conn.execute("insert into 74hu_friend (fid,uid,state) values("&userid&","&id&",0)")
				w "你已成功提交好友申请,等待对方审核,"
			End If
		Case 11:'管理好友
			w "管理好友</div>"&_
				"<div class=""tip"">知己难求,请谨慎操作</div>"&_
				"<div class=""odd""><a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=3"">删除好友</a></div>"&_
				"<div class=""even""><a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&"&amp;a=2"">加黑好友</a></div>"
		Case 1:'同意好友
			w "好友请求</div>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select state,retime from 74hu_friend where uid="&id&" and fid="&userid&" and state=-1"'避免修改对方的黑名单
			rs.open sql,conn,1,3
			If Not rs.eof Then
				rs("state")=1
				rs("retime")=now_
				rs.update
				rs.close
				sql = "select state,retime from 74hu_friend where uid="&userid&" and fid="&id&""
				rs.open sql,conn,1,3
				If Not rs.eof Then
					rs("state")=1
					rs("retime")=now_
					rs.update
				Else
					'不存在好友关系则添加
					conn.execute("insert into 74hu_friend (uid,fid,state,retime) values("&userid&","&id&",1,'"&now_&"')")
				End If
				w "已同意请求,"
			Else
				w "已没有好友请求,"
			End If
			rs.close
			Set rs=Nothing
		Case 2:'加黑名单
			w "黑名单</div>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select state,retime from 74hu_friend where uid="&userid&" and fid="&id&""
			rs.open sql,conn,1,3
			If Not rs.eof Then
				rs("state")=2
				rs("retime")=now_
				rs.update
				rs.close
				Set rs=Nothing
			Else
				rs.close
				Set rs=Nothing
				'不存在好友关系则添加
				conn.execute("insert into 74hu_friend (uid,fid,retime,state) values("&userid&","&id&",'"&now_&"',2)")
			End If
			conn.execute("delete * from 74hu_friend where uid="&id&" and fid="&userid&" and state<>2")'避免修改对方的黑名单
			w "已加对方黑名单!<br/>"
		Case 3:'删除好友
			w"删除好友</div>"
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select uid from 74hu_friend where uid="&id&" and fid="&userid&" and state=2"'避免修改对方的黑名单
			rs.open sql,conn,3,1
			If rs.eof Then
				rs.close
				Set rs=Nothing
				conn.execute("delete * from 74hu_friend where uid="&id&" and fid="&userid&"")
			End If
			conn.execute("delete * from 74hu_friend where uid="&userid&" and fid="&id&"")
			w "删除成功!<br/>"
		' Case 20:'取消加黑 改成 直接删除
			' w "黑名单</div>"
			' Set rs=Server.CreateObject("ADODB.Recordset")
			' sql = "select state from 74hu_friend where uid="&userid&" and fid="&id&" and state=2"
			' rs.open sql,conn,3,1
			' If Not rs.eof Then
				' state=2
				' rs("retime")=now_
				' w "取消黑名单成功!<br/>"
			' Else
				' w "你没有把对方加进黑名单!<br/>"
			' End If
		End Select
	w "<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">返回他(她)的页面</a><br/>"&_
		"<a href="""&http_path&"bbs_friend.asp?"&a_sid&""">我的好友列表</a><br/>"
	End If
End Sub
' wap1.0链接跳转页面
Sub showUrls
	Dim url,siteurl
	url=Replace(LCase(Request.QueryString),"url=","")
	siteurl="http://" & Request.ServerVariables("server_name")
	If InStr(url,"://")=0 Or left(url,Len(siteurl))=siteurl Then
		' w "<card title='站内跳转' ontimer='"&nowml(url)&"'><timer value='1'/><p align="""&wapconst&""">正在转向其他页面..<br/>"&_
			' "<a href="""&nowml(url)&""">访问该页面</a> <a href="""">返回来页</a><br/>"
		r url
	Else
		Set re=new RegExp
		re.IgnoreCase =True
		re.Global=True
		re.Pattern=""&bbssid&"=\w+"
		url=re.Replace(url,"sid=1")
		Set re=Nothing
		w "<card title=""网站跳转""><p align="""&wapconst&""">您即将访问其他网站"&nowml(url)&"，确定离开本站？<br/>"&_
			"<a href="""&nowml(url)&""">访问该网站</a> <a href="""">返回来页</a><br/>"
	End If
End Sub
' wap2.0链接跳转页面
Sub showsUrls
	Dim url,siteurl
	url=Replace(LCase(Request.QueryString),"url=","")
	siteurl="http://" & Request.ServerVariables("server_name")
	If InStr(url,"://")=0 Or left(url,Len(siteurl))=siteurl Then
		' w "<title>站内跳转</title><meta http-equiv='refresh' content='1;url="&nowml(url)&"'></head><body><div class=""main"">正在转向其他页面..<br/>"&_
			' "<a href="""&nowml(url)&""">访问该页面</a> <a href="""">返回来页</a><br/>"
		r url
	Else
		Set re=new RegExp
		re.IgnoreCase =True
		re.Global=True
		re.Pattern=""&bbssid&"=\w+"
		url=re.Replace(url,"sid=1")
		Set re=Nothing
		w "<title>网站跳转</title></head><body><div class=""main"">您即将访问其他网站"&nowml(url)&"，确定离开本站？<br/>"&_
			"<a href="""&nowml(url)&""">访问该网站</a> <a href="""">返回来页</a><br/>"
	End If
End Sub
' wap1.0发信息页面
Sub showMsg
	checkLogin()'验证登录
	Dim id,userid,a
	id=getN("id", 0)
	userid=userArr(0)
	w "<card title=""发信息""><p align="""&wapconst&""">-<a href="""&http_path&"?"&a_sid&""">首页</a>-<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-发信息<br/>"
	a=getN("a", 0)
	If id=userid Then w "不能给自己发信息</p></card><wml>"
	'是否自己好友
	Dim state
	state= getFriendship(id)
	If state<>1 Then wn "对方还不是你好友,请添加好友后发信息<br/>"&showImg("friend")&"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&""">加对方为好友</a></p></card><wml>"
	If a=0 Then
		w "<input type=""text"" name=""text"&time_r&""" value="""" maxlength=""200""/><br/>"&_
			"<anchor>发送<go href="""&http_path&"bbs_msg.asp?"&a_sid&"&amp;id="&id&"&amp;a=1"" method=""post"">"&_
			"<postfield name=""text"" value=""$(text"&time_r&")""/></go></anchor>"
	Else
		Dim text
		text=getD("text", "")
		If text="" Then
			w "信息不能为空!"
		Else
			Dim count'防止刷信息,30秒发信一条
			count=conn.Execute("select count(id) from 74hu_message where userid="&userid&" and (savetime>#"&dateadd("s", -30, time_now)&"#)")(0)
			If count>0 Then wn "为提高聊天质量,两次信息间隔必须大于30秒!</p></card></wml>"
			conn.execute("insert into 74hu_message (userid,receive,content,savetime,state,flag) values("&userid&","&id&",'"&text&"','"&time_now&"',0,0)")
			w "信息发送成功!"
		End If
	End If
	w "<br/>"
End Sub
' wap2.0发信息页面
Sub showsMsg
	checkLogin()'验证登录
	Dim id,userid,a
	id=getN("id", 0)
	userid=userArr(0)
	w "<title>发信息</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-发信息</div>"
	a=getN("a", 0)
	If id=userid Then w "不能给自己发信息</div></body><html>"
	'是否自己好友
	Dim state
	state= getFriendship(id)
	If state<>1 Then wn "对方还不是你好友,请添加好友后发信息<br/>"&showImg("friend")&"<a href="""&http_path&"bbs_friend.asp?id="&id&"&amp;"&a_sid&""">加对方为好友</a></div></body><html>"
	If a=0 Then
		w "<form action="""&http_path&"bbs_msg.asp"" method=""post""><input type=""text"" name=""text"" value="""" maxlength=""200""/>"&_
			"<input type=""hidden"" name=""id"" value="""&id&"""/><input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/>"&_
			"<input type=""hidden"" name=""a"" value=""1""/><input type=""submit"" value=""发送""/></form>"
	Else
		Dim text
		text=getD("text", "")
		If text="" Then
			w "信息不能为空!"
		Else
			Dim count'防止刷信息,30秒发信一条
			count=conn.Execute("select count(id) from 74hu_message where userid="&userid&" and (savetime>#"&dateadd("s", -30, time_now)&"#)")(0)
			If count>0 Then wn "为提高聊天质量,两次信息间隔必须大于30秒!</div></body><html>"
			conn.execute("insert into 74hu_message (userid,receive,content,savetime,state,flag) values("&userid&","&id&",'"&text&"','"&time_now&"',0,0)")
			w "信息发送成功!"
		End If
	End If
	w "<br/>"
End Sub
' wap1.0信箱页面
Sub showMsgs
	checkLogin()'验证登录
	Dim a,rs,sql,userid,id
	Dim pagesize,i,page,pagecount
	a=getN("a", 0)
	userid=userArr(0)
	w "<card title=""消息记录""><p align="""&wapconst&""">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-消息记录<br/>"
	Select Case a
		Case 0:'未看过的消息
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select top 10 m.id,m.content,m.savetime,m.userid,u.name from 74hu_message m left join 74hu_user u on m.userid=u.id where m.state=0 and m.receive="&userid&" and m.flag<>"&userid&" order by m.id desc"
			rs.open sql,conn,1,1
			If Not rs.eof Then
				count=rs.recordcount
				w "共"&count&"条未看消息<br/>"
				'pagesize=10
				' page=getN("page",1)
				' if page<=0 then page=1
				' pagecount=(count+pagesize-1)\pagesize
				' if page>pagecount then page=pagecount
				' rs.move(pagesize*(page-1))
				For i=1 To count
					' If rs.eof Then Exit For
					id =rs("userid")
					tid = rs("id")
					w i&".<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &"</a> "& forDate2(rs("savetime")) & "<br/>"&_
						"<a href="""&http_path&"bbs_msgs.asp?id="&tid&"&amp;"&a_sid&"&amp;a=2"">"&getLeft(rs("content"),10)&"</a><br/>"&_
						""&showImg("del")&"<a href="""&http_path&"bbs_msgs.asp?id="&tid&"&amp;"&a_sid&"&amp;a=3"">删除这条记录</a><br/>"
					rs.movenext
				Next
				' w showsPage("bbs_msgs.asp", "a:"&a, page, pagecount)
			Else
				w "没有新消息!<br/>"
			End If
			rs.close
			Set rs=Nothing
			w "<br/>※功能面板<br/>"&_
				""&showImg("msgto")&"<a href="""&http_path&"bbs_msgs.asp?id="&id&"&amp;"&a_sid&"&amp;a=1"">全部记录</a>"&_
				""&showImg("del")&"<a href="""&http_path&"bbs_msgs.asp?"&a_sid&"&amp;a=3"">删除全部消息</a><br/>"&_
				"※温馨提示<br/>1.当前显示最新的10条信息<br/>2.网站为您保存"&bbsmsgkeep&"天的记录<br/>3.请勿轻信汇款、中奖信息"
		Case 1:'看过的消息
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select m.id,m.content,m.savetime,m.userid,u.name from 74hu_message m left join 74hu_user u on m.userid=u.id where (m.receive="&userid&" or m.userid="&userid&") and m.flag<>"&userid&" order by m.id desc"
			rs.open sql,conn,1,1
			If Not rs.eof Then
				count=rs.recordcount
				w "共"&count&"条消息<br/>"
				pagesize=10
				page=getN("page",1)
				if page<=0 then page=1
				pagecount=(count+pagesize-1)\pagesize
				if page>pagecount then page=pagecount
				rs.move(pagesize*(page-1))
				For i=1 To PageSize
					If rs.eof Then Exit For
					id =rs("userid")
					tid = rs("id")
					w i&".<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &"</a> "& forDate2(rs("savetime")) & "<br/>"&_
						"<a href="""&http_path&"bbs_msgs.asp?id="&tid&"&amp;"&a_sid&"&amp;a=2"">"&getLeft(rs("content"),10)&"</a><br/>"&_
						""&showImg("del")&"<a href="""&http_path&"bbs_msgs.asp?id="&tid&"&amp;"&a_sid&"&amp;a=3"">删除这条记录</a><br/>"
					rs.movenext
				Next
				w showsPage("bbs_msgs.asp", "a:"&a, page, pagecount)
			Else
				w "暂时没有消息!"
			End If
		Case 2:'查看详细
			id=getN("id",0)
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select m.userid,m.content,m.savetime,m.userid,m.state,u.name from 74hu_message m left join 74hu_user u on m.userid=u.id where m.id="&id&" and (m.receive="&userid&" or m.userid="&userid&") and m.flag<>"&userid&" "
			rs.open sql,conn,1,3
			If Not rs.eof Then
				id=rs("userid")
				w "<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &"</a> "& forDate2(rs("savetime")) & "<br/>"&_
					""&noubb(rs("content"))&"<br/>"
				If rs("userid")<>userid And rs("state")=0 Then
					rs("state")=1
					rs.update
				End If
				w ""&showImg("msgto")&"<a href="""&http_path&"bbs_msg.asp?id="&id&"&amp;"&a_sid&""">回复信息</a><br/>"
			Else
				w "没有这条消息!"
			End If
			rs.close
			Set rs=Nothing
		Case 3:'删除记录
			id=getN("id",0)
			If id>0 Then
				Set rs=Server.CreateObject("ADODB.Recordset")
				sql ="select flag from 74hu_message where id="&id&" and (receive="&userid&" or userid="&userid&")"
				rs.open sql,conn,1,3
				If Not rs.eof Then
					Dim flag
					flag=rs("flag")
					If flag=0 Then'消息双方公用,因此删除要确认两次
						rs("flag")=userid
						rs.update
						w "消息删除成功!"
					ElseIf flag=userid Then
						w "没有这条消息!"
					Else
						rs.delete
						rs.update
						w "消息删除成功!"
					End If
				Else
					w "没有这条消息!"
				End If
			Else
				'消息双方公用,因此删除要确认两次
				conn.Execute("delete * from 74hu_message where flag<>"&userid&" and flag<>0 and (receive="&userid&" or userid="&userid&")")
				conn.Execute("update 74hu_message set flag="&userid&" where flag=0 and (receive="&userid&" or userid="&userid&")")
				w "全部消息删除成功!"
			End If
	End Select
	w "<br/>"
End Sub
' wap2.0信箱页面
Sub showsMsgs
	checkLogin()'验证登录
	Dim a,rs,sql,userid,id
	Dim pagesize,i,page,pagecount
	a=getN("a", 0)
	userid=userArr(0)
	w "<title>消息记录</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-消息记录</div>"
	Select Case a
		Case 0:'未看过的消息
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select top 10 m.id,m.content,m.savetime,m.userid,u.name from 74hu_message m left join 74hu_user u on m.userid=u.id where m.state=0 and m.receive="&userid&" and m.flag<>"&userid&" order by m.id desc"
			rs.open sql,conn,1,1
			If Not rs.eof Then
				count=rs.recordcount
				w "共"&count&"条未看消息<br/>"
				'pagesize=10
				' page=getN("page",1)
				' if page<=0 then page=1
				' pagecount=(count+pagesize-1)\pagesize
				' if page>pagecount then page=pagecount
				' rs.move(pagesize*(page-1))
				For i=1 To count
					' If rs.eof Then Exit For
					id =rs("userid")
					tid = rs("id")
					w "<div class=""odd"">"&i&".<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &"</a> "& forDate2(rs("savetime")) & "<br/>"&_
					"<a href="""&http_path&"bbs_msgs.asp?id="&tid&"&amp;"&a_sid&"&amp;a=2"">"&getLeft(rs("content"),10)&"</a></div>"&_
						"<div class=""even"">"&showImg("del")&_
						"<a href="""&http_path&"bbs_msgs.asp?id="&tid&"&amp;"&a_sid&"&amp;a=3"">删除这条记录</a></div>"
					rs.movenext
				Next
				' w showsPage("bbs_msgs.asp", "a:"&a, page, pagecount)
			Else
				w "没有新消息!"
			End If
			rs.close
			Set rs=Nothing
			w "<div class=""nav"">※功能面板</div>"&_
				""&showImg("msgto")&"<a href="""&http_path&"bbs_msgs.asp?id="&id&"&amp;"&a_sid&"&amp;a=1"">全部记录</a>"&_
				""&showImg("del")&"<a href="""&http_path&"bbs_msgs.asp?"&a_sid&"&amp;a=3"">删除全部消息</a>"&_
				"<div class=""nav"">※温馨提示</div>1.当前显示最新的10条信息<br/>2.网站为您保存"&bbsmsgkeep&"天的记录<br/>3.请勿轻信汇款、中奖信息"
		Case 1:'看过的消息
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select m.id,m.content,m.savetime,m.userid,u.name from 74hu_message m left join 74hu_user u on m.userid=u.id where (m.receive="&userid&" or m.userid="&userid&") and m.flag<>"&userid&" order by m.id desc"
			rs.open sql,conn,1,1
			If Not rs.eof Then
				count=rs.recordcount
				w "共"&count&"条消息<br/>"
				pagesize=10
				page=getN("page",1)
				if page<=0 then page=1
				pagecount=(count+pagesize-1)\pagesize
				if page>pagecount then page=pagecount
				rs.move(pagesize*(page-1))
				For i=1 To PageSize
					If rs.eof Then Exit For
					id =rs("userid")
					tid = rs("id")
					w "<div class=""odd"">"&pagesize*(page-1)+i&".<a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &_
						"</a> "& forDate2(rs("savetime")) & "<br/>"&_
						"<a href="""&http_path&"bbs_msgs.asp?id="&tid&"&amp;"&a_sid&"&amp;a=2"">"&getLeft(rs("content"),10)&"</a></div>"&_
						"<div class=""even"">"&showImg("del")&_
						"<a href="""&http_path&"bbs_msgs.asp?id="&tid&"&amp;"&a_sid&"&amp;a=3"">删除这条记录</a></div>"
					rs.movenext
				Next
				w showsPage("bbs_msgs.asp", "a:"&a, page, pagecount)
			Else
				w "暂时没有消息!"
			End If
		Case 2:'查看详细
			id=getN("id",0)
			Set rs=Server.CreateObject("ADODB.Recordset")
			sql = "select m.userid,m.content,m.savetime,m.userid,m.state,u.name from 74hu_message m left join 74hu_user u on m.userid=u.id where m.id="&id&" and (m.receive="&userid&" or m.userid="&userid&") and m.flag<>"&userid&" "
			rs.open sql,conn,1,3
			If Not rs.eof Then
				id=rs("userid")
				w "<div class=""odd""><a href="""&http_path&"bbs_user.asp?id="&id&"&amp;"&a_sid&""">"& rs("name") &"</a> "& forDate2(rs("savetime")) & "</div>"&_
					"<div class=""even"">"&noubb(rs("content"))&"</div>"
				If rs("userid")<>userid And rs("state")=0 Then
					rs("state")=1
					rs.update
				End If
				w "<div class=""odd"">"&showImg("msgto")&"<a href="""&http_path&"bbs_msg.asp?id="&id&"&amp;"&a_sid&""">回复信息</a></div>"
			Else
				w "没有这条消息!"
			End If
			rs.close
			Set rs=Nothing
		Case 3:'删除记录
			id=getN("id",0)
			If id>0 Then
				Set rs=Server.CreateObject("ADODB.Recordset")
				sql ="select flag from 74hu_message where id="&id&" and (receive="&userid&" or userid="&userid&")"
				rs.open sql,conn,1,3
				If Not rs.eof Then
					Dim flag
					flag=rs("flag")
					If flag=0 Then'消息双方公用,因此删除要确认两次
						rs("flag")=userid
						rs.update
						w "消息删除成功!"
					ElseIf flag=userid Then
						w "没有这条消息!"
					Else
						rs.delete
						rs.update
						w "消息删除成功!"
					End If
				Else
					w "没有这条消息!"
				End If
			Else
				'消息双方公用,因此删除要确认两次
				conn.Execute("delete * from 74hu_message where flag<>"&userid&" and flag<>0 and (receive="&userid&" or userid="&userid&")")
				conn.Execute("update 74hu_message set flag="&userid&" where flag=0 and (receive="&userid&" or userid="&userid&")")
				w "全部消息删除成功!"
			End If
	End Select
	w "<br/>"
End Sub
' wap1.0修改资料
Sub showData
	checkLogin()'验证登录
	Dim a,userid,rs,sql
	w "<card title=""修改资料""><p align="""&wapconst&""">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-修改资料<br/>"
	a=getN("a", 0)
	userid=userArr(0)
	If a=0 Then
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select sex,remark,birthday,city from 74hu_user where id="&userid&""
		rs.open sql,conn,1,1
		If Not rs.eof Then'其实可以不用这么做,但降低耦合
			w "性别: <select name=""sex"&time_r&""" value="""&rs("sex")&"""><option value=""0"">保密</option>"&_
				"<option value=""1"">男</option><option value=""2"">女</option></select><br/>"&_
				"签名:<br/><input type=""text"" name=""remark"&time_r&""" value="""&nowml(rs("remark"))&""" maxlength=""100""/><br/>"&_
				"生日:<br/><input type=""text"" name=""birth"&time_r&""" value="""&rs("birthday")&"""/><br/>"&_
				"城市:<br/><input type=""text"" name=""city"&time_r&""" value="""&nowml(rs("city"))&""" maxlength=""20""/><br/>"&_
				"<anchor>提交<go href="""&http_path&"bbs_data.asp?"&a_sid&"&amp;a=1"" method=""post"">"&_
				"<postfield name=""sex"" value=""$(sex"&time_r&")""/><postfield name=""remark"" value=""$(remark"&time_r&")""/>"&_
				"<postfield name=""birth"" value=""$(birth"&time_r&")""/><postfield name=""city"" value=""$(city"&time_r&")""/></go></anchor>"
		End If
		rs.close
		Set rs=Nothing
	Else
		Dim remark,birth,city,sex
		sex=getN("sex",0)
		remark=getD("remark","")
		birth=getD("birth","")
		city=getD("city","")
		If len(remark)>100 Then wn "签名不能太长!</p></card></wml>"
		If birth="" Or IsDate(birth)=False Then wn "生日格式不对,应如2008-8-8</p></card></wml>"
		If len(city)>20 Then wn "城市不能太长!</p></card></wml>"
		conn.execute("update 74hu_user set remark='"&remark&"',birthday='"&birth&"',city='"&city&"',sex="&sex&" where id="&userid)
		w "修改成功!"
	End If
	w "<br/>"
End Sub
' wap2.0修改资料
Sub showsData
	checkLogin()'验证登录
	Dim a,userid,rs,sql
	w "<title>修改资料</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-修改资料</div>"
	a=getN("a", 0)
	userid=userArr(0)
	If a=0 Then
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select sex,remark,birthday,city from 74hu_user where id="&userid&""
		rs.open sql,conn,1,1
		If Not rs.eof Then'其实可以不用这么做,但降低耦合
			Select Case rs("sex")
			Case 1:select1="selected"
			Case 2:select2="selected"
			End Select
			w "<form action="""&http_path&"bbs_data.asp"" method=""post"">"&_
				"性别: <select name=""sex""><option value=""0"">保密</option>"&_
				"<option value=""1"" "&select1&">男</option><option value=""2"" "&select2&">女</option></select><br/>"&_
				"签名:<br/><input type=""text"" name=""remark"" value="""&nowml(rs("remark"))&""" maxlength=""100""/><br/>"&_
				"生日:<br/><input type=""text"" name=""birth"" value="""&rs("birthday")&"""/><br/>"&_
				"城市:<br/><input type=""text"" name=""city"" value="""&nowml(rs("city"))&""" maxlength=""20""/><br/>"&_
				"<input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/>"&_
				"<input type=""hidden"" name=""a"" value=""1""/>"&_
				"<input type=""submit"" value=""提交""/>"
		End If
		rs.close
		Set rs=Nothing
	Else
		Dim remark,birth,city,sex
		sex=getN("sex",0)
		remark=getD("remark","")
		birth=getD("birth","")
		city=getD("city","")
		If len(remark)>100 Then wn "签名不能太长!</div></body></html>"
		If birth="" Or IsDate(birth)=False Then wn "生日格式不对,应如2008-8-8</div></body></html>"
		If len(city)>20 Then wn "城市不能太长!</div></body></html>"
		conn.execute("update 74hu_user set remark='"&remark&"',birthday='"&birth&"',city='"&city&"',sex="&sex&" where id="&userid)
		w "修改成功!"
	End If
	w "<br/>"
End Sub
' wap1.0修改密码
Sub showPassword
	checkLogin()'验证登录
	Dim a,userid,rs,sql
	w "<card title=""修改密码""><p align="""&wapconst&""">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-修改密码<br/>"
	a=getN("a", 0)
	userid=userArr(0)
	If a=0 Then
		w "旧密码:<br/><input type=""text"" name=""old"&time_r&""" value=""""/><br/>"&_
			"新密码:<br/><input type=""text"" name=""new"&time_r&""" value=""""/><br/>"&_
			"重复新密码:<br/><input type=""text"" name=""new2"&time_r&""" value=""""/><br/>"&_
			"<anchor>提交<go href="""&http_path&"bbs_password.asp?"&a_sid&"&amp;a=1"" method=""post"">"&_
			"<postfield name=""old"" value=""$(old"&time_r&")""/><postfield name=""new"" value=""$(new"&time_r&")""/>"&_
			"<postfield name=""new2"" value=""$(new2"&time_r&")""/></go></anchor>"
	Else
		Dim oldpass,newpass,newpass2,passlen
		newpass=getD("new","")
		newpass2=getD("new2","")
		If newpass<>newpass2 Then wn "新密码和重复密码必须相同!</p></card></wml>"
		passlen=len(newpass)
		If passlen>16 Or passlen<6 Then wn "密码长度必须是6-16位!</p></card></wml>"
		oldpass=getD("old","")
		If newpass=oldpass Then wn "新密码和旧密码不能相同!</p></card></wml>"
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select password,sid from 74hu_user where password='"&oldpass&"'"
		rs.open sql,conn,1,3
		If Not rs.eof Then
			rs("password")=newpass
			rs("sid")=getOnlySid()
			rs.update
			w "修改成功!请重新<a href="""&http_path&"bbs_login.asp"">登录</a>"
		Else
			w "密码错误,请输入正确的密码!"
		End If
		rs.close
		Set rs=Nothing
	End If
	w "<br/>"
End Sub
' wap2.0修改密码
Sub showsPassword
	checkLogin()'验证登录
	Dim a,userid,rs,sql
	w "<title>修改密码</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-修改密码</div>"
	a=getN("a", 0)
	userid=userArr(0)
	If a=0 Then
		w "<form action="""&http_path&"bbs_password.asp"" method=""post"">"&_
			"旧密码:<br/><input type=""text"" name=""old"" value=""""/><br/>"&_
			"新密码:<br/><input type=""text"" name=""new"" value=""""/><br/>"&_
			"重复新密码:<br/><input type=""text"" name=""new2"" value=""""/><br/>"&_
			"<input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/>"&_
			"<input type=""hidden"" name=""a"" value=""1""/>"&_
			"<input type=""submit"" value=""提交""/></form>"
	Else
		Dim oldpass,newpass,newpass2,passlen
		newpass=getD("new","")
		newpass2=getD("new2","")
		If newpass<>newpass2 Then wn "新密码和重复密码必须相同!</div></body></html>"
		passlen=len(newpass)
		If passlen>16 Or passlen<3 Then wn "密码长度必须是3-16位!</div></body></html>"
		oldpass=getD("old","")
		If newpass=oldpass Then wn "新密码和旧密码不能相同!</div></body></html>"
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select password,sid from 74hu_user where password='"&oldpass&"'"
		rs.open sql,conn,1,3
		If Not rs.eof Then
			rs("password")=newpass
			rs("sid")=getOnlySid()
			rs.update
			w "修改成功!请重新<a href="""&http_path&"bbs_login.asp"">登录</a>"
		Else
			w "密码错误,请输入正确的密码!"
		End If
		rs.close
		Set rs=Nothing
	End If
	w "<br/>"
End Sub
' wap1.0用户帖子
Sub showMyPost
	Dim id,userid,rs,sql,count,pagecount,page,i,pagesize,pagenum
	id=getN("id",0)
	userid=userArr(0)
	pagesize=10
	page=getN("page",1)
	w "<card title=""用户帖子""><p align="""&wapconst&"""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	w "-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-用户帖子<br/>"
	Set rs=Server.CreateObject("ADODB.Recordset")
	If id=0 Or id=userid Then id=userid
	sql="select id,title,reply,hit from 74hu_topic where userid="&id
	rs.open sql,conn,1,1
	If Not rs.eof Then
		count=rs.recordcount
		w "共"&count&"篇帖子<br/>"
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		pagenum=pagesize*(page-1)*1
		rs.move(pagenum)
		For i=1 To PageSize
			If rs.eof Then Exit For
			w ""&(pagenum+i)&".<a href="""&http_path&"bbs_posts.asp?id="&rs("id")&"&amp;"&a_sid&""">"& noubb(rs("title")) &"</a>["& rs("reply") &"回 / "& rs("hit") &"阅]<br/>"
			rs.movenext
		Next
		w showPage("bbs_mypost.asp", "id:"&id, page, pagecount)
	Else
		w "暂时没有帖子<br/>"
	End If
	rs.close
	Set rs=Nothing
End Sub
' wap2.0用户帖子
Sub showsMyPost
	Dim id,userid,rs,sql,count,pagecount,page,i,pagesize,oddeven,pagenum
	id=getN("id",0)
	userid=userArr(0)
	pagesize=10
	page=getN("page",1)
	w "<title>用户帖子</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	w "<div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-用户帖子</div>"
	Set rs=Server.CreateObject("ADODB.Recordset")
	If id=0 Or id=userid Then id=userid
	sql="select id,title,reply,hit from 74hu_topic where userid="&id
	rs.open sql,conn,1,1
	If Not rs.eof Then
		count=rs.recordcount
		w "共"&count&"篇帖子<br/>"
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		pagenum=pagesize*(page-1)*1
		rs.move(pagenum)
		For i=1 To PageSize
			If rs.eof Then Exit For
			oddeven=i Mod 2
			If oddeven=1 Then
				oddeven="odd"
			Else
				oddeven="even"
			End If
			w "<div class="""&oddeven&""">"&(pagenum+i)&".<a href="""&http_path&"bbs_posts.asp?id="&rs("id")&"&amp;"&a_sid&""">"& noubb(rs("title")) &"</a>["& rs("reply") &"回 / "& rs("hit") &"阅]</div>"
			rs.movenext
		Next
		w showsPage("bbs_mypost.asp", "id:"&id, page, pagecount)
	Else
		w "暂时没有帖子"
	End If
	w "<br/>"
	rs.close
	Set rs=Nothing
End Sub
' wap1.0修改用户名
Sub showUserName
	checkLogin()'验证登录
	Dim a,userid,rs,sql
	w "<card title=""修改用户名""><p align="""&wapconst&""">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-修改用户名<br/>"
	a=getN("a", 0)
	userid=userArr(0)
	If a=0 Then
		w "新用户名:<br/><input type=""text"" name=""new"&time_r&""" value="""" maxlength=""16""/><br/>"&_
			"<anchor>提交<go href="""&http_path&"bbs_username.asp?"&a_sid&"&amp;a=1"" method=""post"">"&_
			"<postfield name=""new"" value=""$(new"&time_r&")""/></go></anchor>"
	Else
		Dim name,namelen
		name=getD("new","")
		namelen=len(name)
		If namelen>16 Or namelen<3 Then wn "用户名长度必须是3-16位!</p></card></wml>"
		If IsNumeric(Mid(name,1,1)) Then wn "用户名不能以数字开头！</p></card></wml>"
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select name from 74hu_user where name='"&name&"' and id<>"&userid
		rs.open sql,conn,1,3
		If Not rs.eof Then
			w "用户名"""&name&"""已存在！请选择其他用户名"
		Else
			conn.execute("update 74hu_user set name='"&name&"' where id="&userid)
			w "用户名修改成功!"
		End If
		rs.close
		Set rs=Nothing
	End If
	w "<br/>"
End Sub
' wap2.0修改用户名
Sub showsUserName
	checkLogin()'验证登录
	Dim a,userid,rs,sql
	w "<title>修改用户名</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-修改用户名</div>"
	a=getN("a", 0)
	userid=userArr(0)
	If a=0 Then
		w "<form action="""&http_path&"bbs_username.asp"" method=""post"">"&_
			"新用户名:<br/><input type=""text"" name=""new"" value=""""/><br/>"&_
			"<input type=""hidden"" name="""&bbssid&""" value="""&sid&"""/>"&_
			"<input type=""hidden"" name=""a"" value=""1""/>"&_
			"<input type=""submit"" value=""提交""/></form>"
	Else
		Dim name,namelen
		name=getD("new","")
		namelen=len(name)
		If namelen>16 Or namelen<3 Then wn "用户名长度必须是3-16位!</div></body></html>"
		If IsNumeric(Mid(name,1,1)) Then wn "用户名不能以数字开头！</div></body></html>"
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select name from 74hu_user where name='"&name&"' and id<>"&userid
		rs.open sql,conn,1,3
		If Not rs.eof Then
			w "用户名"""&name&"""已存在！请选择其他用户名"
		Else
			conn.execute("update 74hu_user set name='"&name&"' where id="&userid)
			w "用户名修改成功!"
		End If
		rs.close
		Set rs=Nothing
	End If
	w "<br/>"
End Sub
' wap1.0安全退出
Sub showLogout
	checkLogin()'验证登录
	Dim a,userid,rs,sql
	w "<card title=""安全退出""><p align="""&wapconst&""">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-安全退出<br/>"
	a=getN("a", 0)
	userid=userArr(0)
	If a=0 Then
		w "安全退出会使书签失效，你确定退出登录？<br/><a href="""&http_path&"bbs_logout.asp?"&a_sid&"&amp;a=1"">对,确定安全退出</a><br/>"&_
			"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">否,返回会员中心</a>"
	Else
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select sid from 74hu_user where sid='"&sid&"'"
		rs.open sql,conn,1,3
		If Not rs.eof Then
			rs("sid")=getOnlySid()
			rs.update
			w "退出成功！重新<a href="""&http_path&"bbs_login.asp"">登录</a>"
		Else
			w "退出失败！"
		End If
		rs.close
		Set rs=Nothing
	End If
	w "<br/><br/>温馨提示：<br/>安全退出可以有效保证账户安全<br/>"
End Sub
' wap2.0安全退出
Sub showsLogout
	checkLogin()'验证登录
	Dim a,userid,rs,sql
	w "<title>安全退出</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-安全退出</div>"
	a=getN("a", 0)
	userid=userArr(0)
	If a=0 Then
		w "安全退出会使书签失效，你确定退出登录？<br/><a href="""&http_path&"bbs_logout.asp?"&a_sid&"&amp;a=1"">对,确定安全退出</a><br/>"&_
			"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">否,返回会员中心</a>"
	Else
		Set rs=Server.CreateObject("ADODB.Recordset")
		sql = "select sid from 74hu_user where sid='"&sid&"'"
		rs.open sql,conn,1,3
		If Not rs.eof Then
			rs("sid")=getOnlySid()
			rs.update
			w "退出成功！重新<a href="""&http_path&"bbs_login.asp"">登录</a>"
		Else
			w "退出失败！"
		End If
		rs.close
		Set rs=Nothing
	End If
	w "<br/><br/>温馨提示：<br/>安全退出可以有效保证账户安全<br/>"
End Sub
' wap1.0会员投稿
Sub showEssay
	checkLogin()'验证登录
	Dim a,userid,text,title,count
	w "<card title=""会员投稿""><p align="""&wapconst&""">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-会员投稿<br/>"
	a=getN("a", 0)
	userid=userArr(0)
	count=conn.execute("select count(id) from 74hu_article where classid=0 and hu_author='"&userid&"'")(0)
	If a=0 Then
		If count>0 Then w "已有"&count&"篇稿子未通过审核<br/>"
		w "标题:<input type=""text"" name=""title"&time_r&""" value="""" maxlength=""30""/><br/>"&_
			"内容:<input type=""text"" name=""text"&time_r&""" value=""""/><br/>"&_
			"<anchor>发布投稿<go href="""&http_path&"bbs_essay.asp?"&a_sid&"&amp;a=1"" method=""post"">"&_
			"<postfield name=""title"" value=""$(title"&time_r&")""/><postfield name=""text"" value=""$(text"&time_r&")""/>"&_
			"</go></anchor><br/>注:投稿内容需管理员审核"
	Else
		title=getD("title","")
		text=getD("text","")
		If text="" Or title="" Then w "标题或内容不能为空<br/>":Exit Sub
		If len(text)<50 Then w "投稿内容不能低于50字<br/>":Exit Sub
		If ifArticleRepeat(title) Then w "站内已存在同样标题的文章<br/>":Exit Sub
		conn.execute("insert into 74hu_article (hu_date,title,test,hu_author,classid)values('"&time_now&"','"&title&"','"&text&"',"&userid&",0)")
		w "投稿成功,请等待管理员审核<br/>"
	End If
End Sub
' wap2.0会员投稿
Sub showsEssay
	checkLogin()'验证登录
	Dim a,userid,text,title,count
	w "<title>会员投稿</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-会员投稿</div>"
	a=getN("a", 0)
	userid=userArr(0)
	count=conn.execute("select count(id) from 74hu_article where classid=0 and hu_author='"&userid&"'")(0)
	If a=0 Then
		If count>0 Then w "已有"&count&"篇稿子未通过审核<br/>"
		w "<form action="""&http_path&"bbs_essay.asp?"&a_sid&"&amp;a=1"" method=""post"">"&_
			"标题:<input type=""text"" name=""title"" value="""" maxlength=""30""/><br/>"&_
			"内容:<input type=""text"" name=""text"" value=""""/><br/>"&_
			"<input type=""submit"" value=""发布投稿""/>"&_
			"</form><br/>注:投稿内容需管理员审核"
	Else
		title=getD("title","")
		text=getD("text","")
		If text="" Or title="" Then w "标题或内容不能为空<br/>":Exit Sub
		If len(text)<50 Then w "投稿内容不能低于50字<br/>":Exit Sub
		If ifArticleRepeat(title) Then w "站内已存在同样标题的文章<br/>":Exit Sub
		conn.execute("insert into 74hu_article (hu_date,title,test,hu_author,classid)values('"&time_now&"','"&title&"','"&text&"',"&userid&",0)")
		w "投稿成功,请等待管理员审核<br/>"
	End If
End Sub
' wap1.0会员稿子
Sub showMyEssay
	Dim id,userid,rs,sql,count,pagecount,page,i,pagesize,pagenum,classid
	id=getN("id",0)
	userid=userArr(0)
	pagesize=10
	page=getN("page",1)
	w "<card title=""用户文章""><p align="""&wapconst&"""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	w "-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-用户文章<br/>"
	Set rs=Server.CreateObject("ADODB.Recordset")
	If id=0 Or id=userid Then id=userid
	sql="select id,title,hit,smspin,classid from 74hu_article where hu_author='"&id&"'"
	rs.open sql,conn,1,1
	If Not rs.eof Then
		count=rs.recordcount
		w "共"&count&"篇文章<br/>"
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		pagenum=pagesize*(page-1)*1
		rs.move(pagenum)
		For i=1 To PageSize
			If rs.eof Then Exit For
			If rs("classid")<>0 Then
				w ""&(pagenum+i)&".<a href="""&http_path&"article.asp?id="&rs("id")&"&amp;"&a_sid&""">"& noubb(rs("title")) &"</a>["& rs("smspin") &"回 / "& rs("hit") &"阅]<br/>"
			Else
				w ""&(pagenum+i)&"."& noubb(rs("title")) &"[未审核]<br/>"
			End If
			rs.movenext
		Next
		w showPage("bbs_myessay.asp", "id:"&id, page, pagecount)
	Else
		w "暂时没有文章<br/>"
	End If
	w ""&showImg("essay")&"<a href="""&http_path&"bbs_essay.asp?"&a_sid&""">我要投稿</a>"
	rs.close
	Set rs=Nothing
End Sub
' wap2.0会员稿子
Sub showsMyEssay
	Dim id,userid,rs,sql,count,pagecount,page,i,pagesize,pagenum,classid
	id=getN("id",0)
	userid=userArr(0)
	pagesize=10
	page=getN("page",1)
	w "<title>用户文章</title></head><body><div class=""main""><a id=""top"" name=""top""></a>"
	checkMsg()'信息
	w "<div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href="""&http_path&"bbs_user.asp?"&a_sid&""">会员中心</a>-用户文章</div>"
	Set rs=Server.CreateObject("ADODB.Recordset")
	If id=0 Or id=userid Then id=userid
	sql="select id,title,hit,smspin,classid from 74hu_article where hu_author='"&id&"'"
	rs.open sql,conn,1,1
	If Not rs.eof Then
		count=rs.recordcount
		w "共"&count&"篇文章<br/>"
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		pagenum=pagesize*(page-1)*1
		rs.move(pagenum)
		For i=1 To PageSize
			If rs.eof Then Exit For
			If rs("classid")<>0 Then
				w ""&(pagenum+i)&".<a href="""&http_path&"article.asp?id="&rs("id")&"&amp;"&a_sid&""">"& noubb(rs("title")) &"</a>["& rs("smspin") &"回 / "& rs("hit") &"阅]<br/>"
			Else
				w ""&(pagenum+i)&"."& noubb(rs("title")) &"[未审核]<br/>"
			End If
			rs.movenext
		Next
		w showsPage("bbs_myessay.asp", "id:"&id, page, pagecount)
	Else
		w "暂时没有文章"
	End If
	w "<br/>"&showImg("essay")&"<a href="""&http_path&"bbs_essay.asp?"&a_sid&""">我要投稿</a><br/>"
	rs.close
	Set rs=Nothing
End Sub
' wap1.0 论坛版务
Function showBoard
	Dim id,rs,a,userid,count
	id=getN("id",0)
	a=getN("a",0)
	userid=userArr(0)
	count=conn.execute("select count(classid) from 74hu_class where lx=3 and relid="&userid&" and classid="&id)(0)
	w "<card title=""论坛版务""><p align="""&wapconst&""">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href='"&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"'>论坛</a>-"
	Select Case a
	Case 0:'显示版务
		w "论坛版务<br/><a href='"&http_path&"bbs_board.asp?id="&id&"&amp;"&a_sid&"&amp;a=1'>会员守则</a> "&_
			"<a href='"&http_path&"bbs_board.asp?id="&id&"&amp;"&a_sid&"&amp;a=2'>版主守则</a><br/>"
		If count<>0 Then
			w "版主特权<br/><a href='"&http_path&"bbs_board.asp?id="&id&"&amp;"&a_sid&"&amp;a=3'>论坛主题</a><br/>"
		End If
	Case 1:'会员守则
		w "会员守则<br/>"&_
			"一、不得利用本站危害国家安全、泄露国家秘密，不得侵犯国家社会集体的和公民的合法权益，不得利用本站传播下列信息：<br/>"&_
			"1、煽动抗拒、破坏宪法和法律、行政法规实施的；<br/>"&_
			"2、煽动颠覆国家政权，推翻社会主义制度的；<br/>"&_
			"3、煽动分裂国家、破坏国家统一的；<br/>"&_
			"4、煽动民族仇恨、民族歧视，破坏民族团结的；<br/>"&_
			"5、捏造或者歪曲事实，散布谣言，扰乱社会秩序的；<br/>"&_
			"6、宣扬封建迷信、淫秽、色情、赌博、暴力、凶杀、恐怖、教唆犯罪的；<br/>"&_
			"7、公然侮辱他人或者捏造事实诽谤他人的，或者进行其他恶意攻击的；<br/>"&_
			"8、损害国家机关信誉的；<br/>"&_
			"9、其他违反宪法和法律行政法规的；<br/>"&_
			"10、进行商业广告行为的。<br/>"&_
			"二、互相尊重，对自己的言论和行为负责。"
	Case 2:'版主守则
		w "版主守则<br/>1、遵守会员守则，做好会员表率<br/>2、对待他人要热心，包容，耐心<br/>3、认真管理论坛，改善论坛气氛"
	Case 3:'论坛主题
		w "论坛主题<br/>"
		If count<>0 Then
			Set rs=Server.CreateObject("ADODB.Recordset")
			rs.open "select wmltxt from 74hu_class where lx=3 and relid="&userid&" and classid="&id,conn,1,1
			If Not rs.eof Then
				Dim wmltxt
				wmltxt=nowml(rs("wmltxt"))
				w "备注:<input name='remark"&time_r&"' value='"&wmltxt&"' maxlength='30'/><br/>"&_
						"<anchor>修改<go method='post' href='"&http_path&"bbs_board.asp?id="&id&"&amp;"&a_sid&"&amp;a=13'>"&_
						"<postfield name='remark' value='$(remark"&time_r&")'/></go></anchor>"
			End If
		End If
	Case 13:'主题修改
		w "论坛主题<br/>"
		If count<>0 Then
			Dim rm
			rm=getD("remark","")
			conn.execute("update 74hu_class set wmltxt='"&rm&"' where lx=3 and classid="&id)
			w "修改成功!"
		End If
	End Select
	w "<br/><a href='"&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"'>返回论坛</a>"
End Function
' wap2.0 论坛版务
Function showsBoard
	Dim id,rs,a,userid,count
	id=getN("id",0)
	a=getN("a",0)
	userid=userArr(0)
	count=conn.execute("select count(classid) from 74hu_class where lx=3 and relid="&userid&" and classid="&id)(0)
	w "<title>论坛版务</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-"&_
		"<a href='"&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"'>论坛</a>-"
	Select Case a
	Case 0:'显示版务
		w "论坛版务</div><a href='"&http_path&"bbs_board.asp?id="&id&"&amp;"&a_sid&"&amp;a=1'>会员守则</a> "&_
			"<a href='"&http_path&"bbs_board.asp?id="&id&"&amp;"&a_sid&"&amp;a=2'>版主守则</a><br/>"
		If count<>0 Then
			w "版主特权<br/><a href='"&http_path&"bbs_board.asp?id="&id&"&amp;"&a_sid&"&amp;a=3'>论坛主题</a><br/>"
		End If
	Case 1:'会员守则
		w "会员守则</div>"&_
			"一、不得利用本站危害国家安全、泄露国家秘密，不得侵犯国家社会集体的和公民的合法权益，不得利用本站传播下列信息：<br/>"&_
			"1、煽动抗拒、破坏宪法和法律、行政法规实施的；<br/>"&_
			"2、煽动颠覆国家政权，推翻社会主义制度的；<br/>"&_
			"3、煽动分裂国家、破坏国家统一的；<br/>"&_
			"4、煽动民族仇恨、民族歧视，破坏民族团结的；<br/>"&_
			"5、捏造或者歪曲事实，散布谣言，扰乱社会秩序的；<br/>"&_
			"6、宣扬封建迷信、淫秽、色情、赌博、暴力、凶杀、恐怖、教唆犯罪的；<br/>"&_
			"7、公然侮辱他人或者捏造事实诽谤他人的，或者进行其他恶意攻击的；<br/>"&_
			"8、损害国家机关信誉的；<br/>"&_
			"9、其他违反宪法和法律行政法规的；<br/>"&_
			"10、进行商业广告行为的。<br/>"&_
			"二、互相尊重，对自己的言论和行为负责。"
	Case 2:'版主守则
		w "版主守则</div>1、遵守会员守则，做好会员表率<br/>2、对待他人要热心，包容，耐心<br/>3、认真管理论坛，改善论坛气氛"
	Case 3:'论坛主题
		w "论坛主题</div>"
		If count<>0 Then
			Set rs=Server.CreateObject("ADODB.Recordset")
			rs.open "select wmltxt from 74hu_class where lx=3 and relid="&userid&" and classid="&id,conn,1,1
			If Not rs.eof Then
				Dim wmltxt
				wmltxt=nowml(rs("wmltxt"))
				w "<form method=""post"" action="""&http_path&"bbs_board.asp?id="&id&"&amp;"&a_sid&"&amp;a=13"">"&_
					"备注:<input name='remark' value='"&wmltxt&"' maxlength='30'/><input type=""submit"" value=""修改""/>"
			End If
		End If
	Case 13:'主题修改
		w "论坛主题</div>"
		If count<>0 Then
			Dim rm
			rm=getD("remark","")
			conn.execute("update 74hu_class set wmltxt='"&rm&"' where lx=3 and classid="&id)
			w "修改成功!"
		End If
	End Select
	w "<br/><a href='"&http_path&"bbs_topic.asp?id="&id&"&amp;"&a_sid&"'>返回论坛</a>"
End Function
' wap1.0在线会员
Function showOnline
	Dim sex,str,sexstr
	sex=getN("sex",0)
	Select Case sex
		Case 1:
			sex="and sex=1"
			str="<a href=""bbs_online.asp?"&a_sid&""">全部</a>.<a href=""bbs_online.asp?sex=2&amp;"&a_sid&""">美女</a>"
			sexstr="男"
		Case 2:
			sex="and sex=2"
			str="<a href=""bbs_online.asp?"&a_sid&""">全部</a>.<a href=""bbs_online.asp?sex=1&amp;"&a_sid&""">帅哥</a>"
			sexstr="女"
		Case Else:
			sex=""
			sexstr=""
			str="<a href=""bbs_online.asp?sex=1&amp;"&a_sid&""">帅哥</a>.<a href=""bbs_online.asp?sex=2&amp;"&a_sid&""">美女</a>"
	End Select
	Dim id,rs,sql,count,pagecount,page,i,pagesize,pagenum
	pagesize=10
	page=getN("page",1)
	w "<card title=""在线会员""><p align="""&wapconst&""">"
	checkMsg()'信息
	w "-<a href="""&http_path&"?"&a_sid&""">首页</a>-在线会员<br/>"
	Set rs=Server.CreateObject("ADODB.Recordset")
	sql="select id,name,sex from 74hu_user where (logtime>#"&dateadd("n", -20, time_now)&"#) "&sex&" order by logtime desc"
	rs.open sql,conn,1,1
	If Not rs.eof Then
		count=rs.recordcount
		w ""&count&"位"&sexstr&"会员在线."&str&"<br/>"
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		pagenum=pagesize*(page-1)*1
		rs.move(pagenum)
		For i=1 To PageSize
			If rs.eof Then Exit For
				w ""&(pagenum+i)&".<a href="""&http_path&"bbs_user.asp?id="&rs("id")&"&amp;"&a_sid&""">"& noubb(rs("name")) &"</a>["& getBbsSex(rs("sex")) &"]<br/>"
			rs.movenext
		Next
		w showPage("bbs_online.asp", "sex:"&sex, page, pagecount)
	Else
		w "没有"&sexstr&"会员在线."&str&"<br/>"
	End If
	rs.close
	Set rs=Nothing
End Function
' wap2.0在线会员
Function showsOnline
	Dim sex,str,sexstr
	sex=getN("sex",0)
	Select Case sex
		Case 1:
			sex="and sex=1"
			str="<a href=""bbs_online.asp?"&a_sid&""">全部</a>.<a href=""bbs_online.asp?sex=2&amp;"&a_sid&""">美女</a>"
			sexstr="男"
		Case 2:
			sex="and sex=2"
			str="<a href=""bbs_online.asp?"&a_sid&""">全部</a>.<a href=""bbs_online.asp?sex=1&amp;"&a_sid&""">帅哥</a>"
			sexstr="女"
		Case Else:
			sex=""
			sexstr=""
			str="<a href=""bbs_online.asp?sex=1&amp;"&a_sid&""">帅哥</a>.<a href=""bbs_online.asp?sex=2&amp;"&a_sid&""">美女</a>"
	End Select
	Dim id,rs,sql,count,pagecount,page,i,pagesize,pagenum
	pagesize=10
	page=getN("page",1)
	w "<title>在线会员</title></head><body><div class=""main"">"
	checkMsg()'信息
	w "<div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-在线会员</div>"
	Set rs=Server.CreateObject("ADODB.Recordset")
	sql="select id,name,sex from 74hu_user where (logtime>#"&dateadd("n", -20, time_now)&"#) "&sex&" order by logtime desc"
	rs.open sql,conn,1,1
	If Not rs.eof Then
		count=rs.recordcount
		w ""&count&"位"&sexstr&"会员在线."&str&"<br/>"
		pagecount=(count+pagesize-1)\pagesize
		if page>pagecount then page=pagecount
		pagenum=pagesize*(page-1)*1
		rs.move(pagenum)
		For i=1 To PageSize
			If rs.eof Then Exit For
				w ""&(pagenum+i)&".<a href="""&http_path&"bbs_user.asp?id="&rs("id")&"&amp;"&a_sid&""">"& noubb(rs("name")) &"</a>["& getBbsSex(rs("sex")) &"]<br/>"
			rs.movenext
		Next
		w showsPage("bbs_online.asp", "sex:"&sex, page, pagecount)
	Else
		w "没有"&sexstr&"会员在线."&str&"<br/>"
	End If
	rs.close
	Set rs=Nothing
End Function
' wap1.0今日更新
Sub showNew
	Dim id,rs,sql,count,pagecount,page,i,pagesize,pagenum,a
	pagesize=numlist
	page=getN("page",1)
	a=getD("type",0)
	w "<card title=""今日更新资源""><p align="""&wapconst&""">"
	checkMsg()'信息
	Set rs=Server.CreateObject("ADODB.Recordset")
	If a=0 Then
		w "-<a href="""&http_path&"?"&a_sid&""">首页</a>-今日文章-<a href="""&http_path&"new.asp?type=1&amp;"&a_sid&""">帖子</a><br/>"
		sql="select title,id from 74hu_article where (hu_date>#"&dateadd("d", -1, time_now)&"#) order by id desc"
		rs.open sql,conn,1,1
		If Not rs.eof Then
			count=rs.recordcount
			w "今日新增文章"&count&"篇<br/>"
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			pagenum=pagesize*(page-1)*1
			rs.move(pagenum)
			For i=1 To PageSize
				If rs.eof Then Exit For
					w ""&(pagenum+i)&".<a href="""&http_path&"article.asp?id="&rs("id")&"&amp;"&a_sid&""">"& noubb(rs("title")) &"</a><br/>"
				rs.movenext
			Next
			w showPage("new.asp", "", page, pagecount)
		Else
			w "今日没有文章更新<br/>"
		End If
	Else
		w "-<a href="""&http_path&"?"&a_sid&""">首页</a>-今日帖子-<a href="""&http_path&"new.asp?"&a_sid&""">文章</a><br/>"
		sql="select title,id from 74hu_topic where (savetime>#"&dateadd("d", -1, time_now)&"#) order by id desc"
		rs.open sql,conn,1,1
		If Not rs.eof Then
			count=rs.recordcount
			w "今日新增帖子"&count&"篇<br/>"
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			pagenum=pagesize*(page-1)*1
			rs.move(pagenum)
			For i=1 To PageSize
				If rs.eof Then Exit For
					w ""&(pagenum+i)&".<a href="""&http_path&"bbs_posts.asp?id="&rs("id")&"&amp;"&a_sid&""">"& noubb(rs("title")) &"</a><br/>"
				rs.movenext
			Next
			w showPage("new.asp", "type:"&a, page, pagecount)
		Else
			w "今日没有帖子更新<br/>"
		End If
	End If
	rs.close
	Set rs=Nothing
End Sub
' wap2.0今日更新
Sub showsNew
	Dim id,rs,sql,count,pagecount,page,i,pagesize,pagenum,a
	pagesize=numlist
	page=getN("page",1)
	a=getD("type",0)
	w "<title>今日更新资源</title></head><body><div class=""main"">"
	checkMsg()'信息
	Set rs=Server.CreateObject("ADODB.Recordset")
	If a=0 Then
		w "<div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-今日文章-<a href="""&http_path&"new.asp?type=1&amp;"&a_sid&""">帖子</a></div>"
		sql="select title,id from 74hu_article where (hu_date>#"&dateadd("d", -1, time_now)&"#) order by id desc"
		rs.open sql,conn,1,1
		If Not rs.eof Then
			count=rs.recordcount
			w "今日新增文章"&count&"篇<br/>"
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			pagenum=pagesize*(page-1)*1
			rs.move(pagenum)
			For i=1 To PageSize
				If rs.eof Then Exit For
					w ""&(pagenum+i)&".<a href="""&http_path&"article.asp?id="&rs("id")&"&amp;"&a_sid&""">"& noubb(rs("title")) &"</a><br/>"
				rs.movenext
			Next
			w showsPage("new.asp", "", page, pagecount)
		Else
			w "今日没有文章更新<br/>"
		End If
	Else
		w "<div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-今日帖子-<a href="""&http_path&"new.asp?"&a_sid&""">文章</a></div>"
		sql="select title,id from 74hu_topic where (savetime>#"&dateadd("d", -1, time_now)&"#) order by id desc"
		rs.open sql,conn,1,1
		If Not rs.eof Then
			count=rs.recordcount
			w "今日新增帖子"&count&"篇<br/>"
			pagecount=(count+pagesize-1)\pagesize
			if page>pagecount then page=pagecount
			pagenum=pagesize*(page-1)*1
			rs.move(pagenum)
			For i=1 To PageSize
				If rs.eof Then Exit For
					w ""&(pagenum+i)&".<a href="""&http_path&"bbs_posts.asp?id="&rs("id")&"&amp;"&a_sid&""">"& noubb(rs("title")) &"</a><br/>"
				rs.movenext
			Next
			w showsPage("new.asp", "type:"&a, page, pagecount)
		Else
			w "今日没有帖子更新<br/>"
		End If
	End If
	rs.close
	Set rs=Nothing
End Sub
' wap1.0版面切换
Sub showStyle
	Dim a,u
	a=getN("type",0)
	u=Request.QueryString("_u")
	w "<card title=""简彩版切换""><p align="""&wapconst&""">-<a href="""&http_path&"?"&a_sid&""">首页</a>-简彩版切换<br/>"
	If a=0 Then
		w "确定切换到wap2.0？<br/><a href="""&http_path&"style.asp?type=2&amp;"&a_sid&""">是,切换到2.0页面</a>"
	Elseif a=2 Then
		Session("style")=3
		w "已经帮您配置好！<a href="""&http_path&"?aid=index&amp;"&a_sid&""">马上体验效果!</a>"
	Else
		w "已经是1.0页面了！"
	End If
	If u<>"" Then w " <a href="""&getBackUrl(u)&"&amp;"&a_sid&""">返回来页</a>"
End Sub
' wap2.0版面切换
Sub showsStyle
	Dim a,u
	a=getN("type",0)
	u=Request.QueryString("_u")
	w "<title>简彩版切换</title></head><body><div class=""main""><div class=""nav"">-<a href="""&http_path&"?"&a_sid&""">首页</a>-简彩版切换</div>"
	If a=0 Then
		w "您确定使用切换到wap1.0页面吗？<br/><a href="""&http_path&"style.asp?type=1&amp;"&a_sid&""">是,切换到1.0页面</a>"
		If ifWeb Then w "<div class=""tip"">经检测，您的页面不支持wml，为了防止错误，设置无法生效！</div>"
	Elseif a=1 Then
		Session("style")=1
		w "已经帮您配置好！<a href="""&http_path&"?aid=index&amp;"&a_sid&""">马上体验效果!</a>"
	Else
		w "已经是2.0页面了！"
	End If
	If u<>"" Then w " <a href="""&getBackUrl(u)&"&amp;"&a_sid&""">返回来页</a>"
End Sub
%>